Skip to contentSkip to conversation

MIPS: Fix PKMAP with 32-bit MIPS huge page support

PATCH RESEND Applied Wei Li 2 participants 2 messages Jun 29, 2021 – Jun 30, 2021 MIPS

lore
Share & tools
lore

Wei Li

author
#0 lore raw

PATCH RESEND 1/1 MIPS: Fix PKMAP with 32-bit MIPS huge page support

When 32-bit MIPS huge page support is enabled, we halve the number of pointers a PTE page holds, making its last half go to waste. Correspondingly, we should halve the number of kmap entries, as we just initialized only a single pte table for that in pagetable_init().

Fixes 35476311e529 ("MIPS: Add partial 32-bit huge page support")
---
 arch/mips/include/asm/highmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/highmem.h +1 -1
index 292d0425717f..92a380210017 100644
@@ -36,7 +36,7 @@ extern pte_t *pkmap_page_table;
  * easily, subsequent pte tables have to be allocated in one physical
  * chunk of RAM.
  */
-#ifdef CONFIG_PHYS_ADDR_T_64BIT
+#if defined(CONFIG_PHYS_ADDR_T_64BIT) || defined(CONFIG_MIPS_HUGE_TLB_SUPPORT)
 #define LAST_PKMAP 512
 #else
 #define LAST_PKMAP 1024
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Wei Li

When 32-bit MIPS huge page support is enabled, we halve the number of pointers a PTE page holds, making its last half go to waste. Correspondingly, we should halve the number of kmap entries, as we just initialized only a single pte table for that in pagetable_init().

Fixes 35476311e529 ("MIPS: Add partial 32-bit huge page support")
---
 arch/mips/include/asm/highmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]