310-no_highpage.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --- a/arch/mips/include/asm/page.h
  2. +++ b/arch/mips/include/asm/page.h
  3. @@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl
  4. #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
  5. #include <linux/pfn.h>
  6. +#include <asm/cpu-features.h>
  7. extern void build_clear_page(void);
  8. extern void build_copy_page(void);
  9. @@ -105,13 +106,16 @@ static inline void clear_user_page(void
  10. flush_data_cache_page((unsigned long)addr);
  11. }
  12. -extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
  13. - struct page *to);
  14. -struct vm_area_struct;
  15. -extern void copy_user_highpage(struct page *to, struct page *from,
  16. - unsigned long vaddr, struct vm_area_struct *vma);
  17. +static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
  18. + struct page *to)
  19. +{
  20. + extern void (*flush_data_cache_page)(unsigned long addr);
  21. -#define __HAVE_ARCH_COPY_USER_HIGHPAGE
  22. + copy_page(vto, vfrom);
  23. + if (!cpu_has_ic_fills_f_dc ||
  24. + pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
  25. + flush_data_cache_page((unsigned long)vto);
  26. +}
  27. /*
  28. * These are used to make use of C type-checking..
  29. --- a/arch/mips/mm/init.c
  30. +++ b/arch/mips/mm/init.c
  31. @@ -149,30 +149,6 @@ void kunmap_coherent(void)
  32. pagefault_enable();
  33. }
  34. -void copy_user_highpage(struct page *to, struct page *from,
  35. - unsigned long vaddr, struct vm_area_struct *vma)
  36. -{
  37. - void *vfrom, *vto;
  38. -
  39. - vto = kmap_atomic(to);
  40. - if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
  41. - page_mapped(from) && !Page_dcache_dirty(from)) {
  42. - vfrom = kmap_coherent(from, vaddr);
  43. - copy_page(vto, vfrom);
  44. - kunmap_coherent();
  45. - } else {
  46. - vfrom = kmap_atomic(from);
  47. - copy_page(vto, vfrom);
  48. - kunmap_atomic(vfrom);
  49. - }
  50. - if ((!cpu_has_ic_fills_f_dc) ||
  51. - pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
  52. - flush_data_cache_page((unsigned long)vto);
  53. - kunmap_atomic(vto);
  54. - /* Make sure this page is cleared on other CPU's too before using it */
  55. - smp_wmb();
  56. -}
  57. -
  58. void copy_to_user_page(struct vm_area_struct *vma,
  59. struct page *page, unsigned long vaddr, void *dst, const void *src,
  60. unsigned long len)