Skip to contentSkip to conversation

RISC-V: mm: Support huge page in vmalloc_fault()

PATCH RESEND Applied Dylan Jhong 3 participants 3 messages Mar 10, 2023 – Mar 15, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 RISC-V: mm: Support huge page in vmalloc_fault()

Since RISC-V supports ioremap() with huge page (pud/pmd) mapping, However, vmalloc_fault() assumes that the vmalloc range is limited to pte mappings. To complete the vmalloc_fault() function by adding huge page support.

Fixes 310f541a027b ("riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT")

---
Changes in v2:
- Fix format of commit message

---
 arch/riscv/mm/fault.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/riscv/mm/fault.c +5 -0
index eb0774d9c03b..4b9953b47d81 100644
@@ -143,6 +143,8 @@ static inline void vmalloc_fault(struct pt_regs *regs, int code, unsigned long a
 		no_context(regs, addr);
 		return;
 	}
+	if (pud_leaf(*pud_k))
+		goto flush_tlb;
 
 	/*
 	 * Since the vmalloc area is global, it is unnecessary
@@ -153,6 +155,8 @@ static inline void vmalloc_fault(struct pt_regs *regs, int code, unsigned long a
 		no_context(regs, addr);
 		return;
 	}
+	if (pmd_leaf(*pmd_k))
+		goto flush_tlb;
 
 	/*
 	 * Make sure the actual PTE exists as well to
@@ -172,6 +176,7 @@ static inline void vmalloc_fault(struct pt_regs *regs, int code, unsigned long a
 	 * ordering constraint, not a cache flush; it is
 	 * necessary even after writing invalid entries.
 	 */
+flush_tlb:
 	local_flush_tlb_page(addr);
 }
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Dylan Jhong

Since RISC-V supports ioremap() with huge page (pud/pmd) mapping, However, vmalloc_fault() assumes that the vmalloc range is limited to pte mappings. To complete the vmalloc_fault() function by adding huge page support.

Applied, thanks!

[1/1] RISC-V: mm: Support huge page in vmalloc_fault()

      https://git.kernel.org/palmer/c/47dd902aaee9

Best regards,

Signature · 1 line
Palmer Dabbelt <[email protected]>
#2 lore raw
In reply to Dylan Jhong
This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <[email protected]>:

Quoted 10 lines · On Fri, 10 Mar 2023 15:50:21 +0800 you wrote:

Since RISC-V supports ioremap() with huge page (pud/pmd) mapping, However, vmalloc_fault() assumes that the vmalloc range is limited to pte mappings. To complete the vmalloc_fault() function by adding huge page support.

Fixes 310f541a027b ("riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT")

[...]

Here is the summary with links:
- [RESEND,v2] RISC-V: mm: Support huge page in vmalloc_fault()

    https://git.kernel.org/riscv/c/47dd902aaee9

You are awesome, thank you!

Signature · 9 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv