powerpc/mm: Fix little-endian 4K hugetlb
When we switched to big endian page table, we never updated the hugepd
format such that it can work for both big endian and little endian
config. This patch series update hugepd format such that it is looked at
as __be64 value in big endian page table config.
This patch also switch hugepd_t.pd from signed long to unsigned long.
I did update the FSL hugepd_ok check to check for the top bit instead
of checking > 0.
Fixes: 5dc1ef858c
("powerpc/mm: Use big endian Linux page tables for book3s 64")
Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
ff8b85796d
commit
20717e1ff5
@@ -36,12 +36,13 @@
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
static inline int hash__hugepd_ok(hugepd_t hpd)
|
||||
{
|
||||
unsigned long hpdval = hpd_val(hpd);
|
||||
/*
|
||||
* if it is not a pte and have hugepd shift mask
|
||||
* set, then it is a hugepd directory pointer
|
||||
*/
|
||||
if (!(hpd.pd & _PAGE_PTE) &&
|
||||
((hpd.pd & HUGEPD_SHIFT_MASK) != 0))
|
||||
if (!(hpdval & _PAGE_PTE) &&
|
||||
((hpdval & HUGEPD_SHIFT_MASK) != 0))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user