On 11/18/25 7:59 AM, [email protected] wrote:
From: Yong-Xuan Wang <[email protected]>

The pmlen should get the corresponding value before shifting address.

Signed-off-by: Yong-Xuan Wang <[email protected]>
Reviewed-by: Frank Chang <[email protected]>
---

Reviewed-by: Daniel Henrique Barboza <[email protected]>

  target/riscv/internals.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/internals.h b/target/riscv/internals.h
index 172296f12e2..9b3f01144d2 100644
--- a/target/riscv/internals.h
+++ b/target/riscv/internals.h
@@ -203,8 +203,8 @@ static inline target_ulong adjust_addr_body(CPURISCVState 
*env,
      if (!is_virt_addr) {
          signext = riscv_cpu_virt_mem_enabled(env);
      }
-    addr = addr << pmlen;
      pmlen = riscv_pm_get_pmlen(pmm);
+    addr = addr << pmlen;
/* sign/zero extend masked address by N-1 bit */
      if (signext) {


Reply via email to