--- zzzz-none-000/linux-3.10.107/arch/powerpc/include/asm/pte-hash64-64k.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/powerpc/include/asm/pte-hash64-64k.h 2021-02-04 17:41:59.000000000 +0000 @@ -40,8 +40,6 @@ #ifndef __ASSEMBLY__ -#include /* for smp_rmb() */ - /* * With 64K pages on hash table, we have a special PTE format that * uses a second "half" of the page table to encode sub-page information @@ -97,7 +95,8 @@ (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K) #define remap_4k_pfn(vma, addr, pfn, prot) \ - remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \ - __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN)) + (WARN_ON(((pfn) >= (1UL << (64 - PTE_RPN_SHIFT)))) ? -EINVAL : \ + remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \ + __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN))) #endif /* __ASSEMBLY__ */