summary refs log tree commit diff stats
path: root/target/hppa/sys_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-10-27 04:10:45 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-11-06 18:49:34 -0800
commitb10700d826c864872deae6c28aca041fc97df79f (patch)
tree919c22e43e88e94d017c139b83b027960dc926ca /target/hppa/sys_helper.c
parent8a02b9a68e4cded2b8751d803a3e3aedfce93609 (diff)
downloadfocaccia-qemu-b10700d826c864872deae6c28aca041fc97df79f.tar.gz
focaccia-qemu-b10700d826c864872deae6c28aca041fc97df79f.zip
target/hppa: Update IIAOQ, IIASQ for pa2.0
These registers have a different format for pa2.0.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa/sys_helper.c')
-rw-r--r--target/hppa/sys_helper.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c
index 8850576ac3..a59245eed3 100644
--- a/target/hppa/sys_helper.c
+++ b/target/hppa/sys_helper.c
@@ -80,6 +80,16 @@ void HELPER(rfi)(CPUHPPAState *env)
     env->iasq_b = (uint64_t)env->cr_back[0] << 32;
     env->iaoq_f = env->cr[CR_IIAOQ];
     env->iaoq_b = env->cr_back[1];
+
+    /*
+     * For pa2.0, IIASQ is the top bits of the virtual address.
+     * To recreate the space identifier, remove the offset bits.
+     */
+    if (hppa_is_pa20(env)) {
+        env->iasq_f &= ~env->iaoq_f;
+        env->iasq_b &= ~env->iaoq_b;
+    }
+
     cpu_hppa_put_psw(env, env->cr[CR_IPSW]);
 }