diff mbox series

[2/3] MIPS: Disable hugepages for MIPS32 with 4KB pages

Message ID 20190918220258.29428-2-paul.burton@mips.com (mailing list archive)
State Rejected
Headers show
Series [1/3] MIPS: Disable pte_special() for MIPS32 with 4KiB pages & RiXi | expand

Commit Message

Paul Burton Sept. 18, 2019, 10:03 p.m. UTC
Commit 35476311e529 ("MIPS: Add partial 32-bit huge page support") added
support for huge pages in MIPS32 kernels, which requires the addition of
the _PAGE_HUGE pgprot flag to PTEs. Unfortunately for configurations
that support RiXI this pushed the number of pgprot bits to 13 (ie.
_PFN_SHIFT = 13). When using 4KB pages (ie. PAGE_SHIFT = 12) this
results in us shifting the most significant bit of the physical address
beyond the end of the PTE, leading any mapped access to a physical
address above 2GB to incorrectly access an address 2GB lower than
intended.

Separately, commit 61cbfff4b1a7 ("MIPS: pte_special()/pte_mkspecial()
support") added support for pte_special() which involved another new
pgprot bit. This leads the lack of an available pgprot bit for
_PAGE_HUGE in MIPS32 4KiB page configurations to be extended to non-RiXi
configurations too.

Disable huge page support for the affected configurations to prevent
unexpected misbehaviour.

Fixes: 35476311e529 ("MIPS: Add partial 32-bit huge page support")
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Daniel Silsby <dansilsby@gmail.com>
Cc: Dmitry Korotin <dkorotin@wavecomp.com>
Cc: Paul Cercueil <paul@crapouillou.net>
---

 arch/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 18163c138676..fb75ed5443b8 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1227,7 +1227,7 @@  config SYS_SUPPORTS_LITTLE_ENDIAN
 
 config SYS_SUPPORTS_HUGETLBFS
 	bool
-	depends on CPU_SUPPORTS_HUGEPAGES
+	depends on CPU_SUPPORTS_HUGEPAGES && !(32BIT && PAGE_SIZE_4KB)
 	default y
 
 config MIPS_HUGE_TLB_SUPPORT