public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH v2] RISC-V: mm: Support huge page in vmalloc_fault()
@ 2023-03-10  7:50 Dylan Jhong
  2023-03-15  2:15 ` Palmer Dabbelt
  2023-03-15  2:20 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 3+ messages in thread
From: Dylan Jhong @ 2023-03-10  7:50 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: liushixin2, x5710999x, bjorn, abrestic, peterx, hanchuanhua,
	apopple, hca, aou, palmer, paul.walmsley, tim609, peterlin,
	ycliang, Dylan Jhong, Alexandre Ghiti

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")
Signed-off-by: Dylan Jhong <dylan@andestech.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

---
Changes in v2:
  - Fix format of commit message
---
 arch/riscv/mm/fault.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
index eb0774d9c03b..4b9953b47d81 100644
--- a/arch/riscv/mm/fault.c
+++ b/arch/riscv/mm/fault.c
@@ -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);
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH v2] RISC-V: mm: Support huge page in vmalloc_fault()
  2023-03-10  7:50 [RESEND PATCH v2] RISC-V: mm: Support huge page in vmalloc_fault() Dylan Jhong
@ 2023-03-15  2:15 ` Palmer Dabbelt
  2023-03-15  2:20 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2023-03-15  2:15 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, Dylan Jhong
  Cc: liushixin2, x5710999x, Bjorn Topel, abrestic, peterx, hanchuanhua,
	apopple, hca, aou, Palmer Dabbelt, Paul Walmsley, tim609,
	peterlin, ycliang, Alexandre Ghiti


On Fri, 10 Mar 2023 15:50:21 +0800, Dylan Jhong 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.
> 
> 

Applied, thanks!

[1/1] RISC-V: mm: Support huge page in vmalloc_fault()
      https://git.kernel.org/palmer/c/47dd902aaee9

Best regards,
-- 
Palmer Dabbelt <palmer@rivosinc.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH v2] RISC-V: mm: Support huge page in vmalloc_fault()
  2023-03-10  7:50 [RESEND PATCH v2] RISC-V: mm: Support huge page in vmalloc_fault() Dylan Jhong
  2023-03-15  2:15 ` Palmer Dabbelt
@ 2023-03-15  2:20 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2023-03-15  2:20 UTC (permalink / raw)
  To: Dylan Jhong
  Cc: linux-riscv, linux-kernel, liushixin2, x5710999x, bjorn, abrestic,
	peterx, hanchuanhua, apopple, hca, aou, palmer, paul.walmsley,
	tim609, peterlin, ycliang, alexghiti

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

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")
> Signed-off-by: Dylan Jhong <dylan@andestech.com>
> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-15  2:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10  7:50 [RESEND PATCH v2] RISC-V: mm: Support huge page in vmalloc_fault() Dylan Jhong
2023-03-15  2:15 ` Palmer Dabbelt
2023-03-15  2:20 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox