qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode
@ 2024-04-01 14:52 Sven Schnelle
  2024-04-01 18:43 ` Richard Henderson
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Schnelle @ 2024-04-01 14:52 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel, Helge Deller, Sven Schnelle

For unknown reasons, Java 1.5 on 64-bit HP-UX 11.11 does signed
computation of the new IAOQ value in the signal handler. In the
current code these bits are not masked when returning to narrow
mode, causing java to crash.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 target/hppa/sys_helper.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c
index 208e51c086..3bbc2da71b 100644
--- a/target/hppa/sys_helper.c
+++ b/target/hppa/sys_helper.c
@@ -83,6 +83,10 @@ void HELPER(rfi)(CPUHPPAState *env)
     env->iaoq_f = env->cr[CR_IIAOQ];
     env->iaoq_b = env->cr_back[1];
 
+    if (!(env->cr[CR_IPSW] & PSW_W)) {
+        env->iaoq_f &= 0xffffffff;
+        env->iaoq_b &= 0xffffffff;
+    }
     /*
      * For pa2.0, IIASQ is the top bits of the virtual address.
      * To recreate the space identifier, remove the offset bits.
-- 
2.43.2



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

end of thread, other threads:[~2024-04-01 21:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-01 14:52 [PATCH] target/hppa: mask upper iaoq bits when returning to narrow mode Sven Schnelle
2024-04-01 18:43 ` Richard Henderson
2024-04-01 20:39   ` Sven Schnelle
2024-04-01 20:49     ` Sven Schnelle
2024-04-01 20:56       ` Sven Schnelle
2024-04-01 21:17         ` Richard Henderson
2024-04-01 21:21     ` Richard Henderson
2024-04-01 21:31       ` Sven Schnelle

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).