From: Palmer Dabbelt <palmer@rivosinc.com>
To: alexandre.ghiti@canonical.com, linux-riscv@lists.infradead.org
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Subject: [PATCH] RISC-V: Allow the used to downgrade to sv48 when HW supports sv57
Date: Fri, 22 Apr 2022 14:10:55 -0700 [thread overview]
Message-ID: <20220422211055.9278-1-palmer@rivosinc.com> (raw)
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
next reply other threads:[~2022-04-22 21:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 21:10 Palmer Dabbelt [this message]
2022-04-22 22:01 ` [PATCH] RISC-V: Allow the used to downgrade to sv48 when HW supports sv57 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220422211055.9278-1-palmer@rivosinc.com \
--to=palmer@rivosinc.com \
--cc=alexandre.ghiti@canonical.com \
--cc=linux-riscv@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox