From: Hiroaki Yamamoto <hrak1529@gmail.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] target/riscv: Fix privilege mode of G-stage translation for debugging
Date: Wed, 28 Feb 2024 17:10:28 +0900 [thread overview]
Message-ID: <20240228081028.35081-1-hrak1529@gmail.com> (raw)
G-stage translation should be considered to be user-level access in riscv_cpu_get_phys_page_debug(), as already done in riscv_cpu_tlb_fill().
This fixes a bug that prevents gdb from reading memory while the VM is running in VS-mode.
Signed-off-by: Hiroaki Yamamoto <hrak1529@gmail.com>
---
target/riscv/cpu_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index d462d95ee1..6e13069da7 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -1212,7 +1212,7 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
if (env->virt_enabled) {
if (get_physical_address(env, &phys_addr, &prot, phys_addr, NULL,
- 0, mmu_idx, false, true, true)) {
+ 0, MMUIdx_U, false, true, true)) {
return -1;
}
}
--
2.43.2
next reply other threads:[~2024-02-28 12:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 8:10 Hiroaki Yamamoto [this message]
2024-03-07 2:30 ` [PATCH] target/riscv: Fix privilege mode of G-stage translation for debugging Alistair Francis
2024-03-07 2:36 ` Alistair Francis
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=20240228081028.35081-1-hrak1529@gmail.com \
--to=hrak1529@gmail.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).