Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Allow the used to downgrade to sv48 when HW supports sv57
@ 2022-04-22 21:10 Palmer Dabbelt
  2022-04-22 22:01 ` Andreas Schwab
  2022-04-25 12:42 ` Geert Uytterhoeven
  0 siblings, 2 replies; 8+ messages in thread
From: Palmer Dabbelt @ 2022-04-22 21:10 UTC (permalink / raw)
  To: alexandre.ghiti, linux-riscv; +Cc: Palmer Dabbelt

Similar to the previous patch, this allows a dt-selected downgrade to
sv48 on systems that support sv57 in case users don't need the extra VA
bits and want to save memory or improve performance.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
This is on top of the patches from Alex's set that I dropped.
---
 arch/riscv/mm/init.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 16a0fa2e8432..33f7f9357ffa 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -740,6 +740,11 @@ static __init void set_satp_mode(uintptr_t dtb_pa)
 			if (!mmu_type)
 				continue;
 
+			if (!strcmp(mmu_type, "riscv,sv48")) {
+				disable_pgtable_l5();
+				return;
+			}
+
 			if (!strcmp(mmu_type, "riscv,sv39")) {
 				disable_pgtable_l5();
 				disable_pgtable_l4();
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2022-06-02  3:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 21:10 [PATCH] RISC-V: Allow the used to downgrade to sv48 when HW supports sv57 Palmer Dabbelt
2022-04-22 22:01 ` Andreas Schwab
2022-04-25 12:42 ` Geert Uytterhoeven
2022-04-25 13:14   ` Anup Patel
2022-04-25 13:36     ` Geert Uytterhoeven
2022-04-25 14:13       ` Anup Patel
2022-04-25 14:30         ` Geert Uytterhoeven
2022-06-02  3:27           ` Palmer Dabbelt

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