[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/9] target/hppa: Avoid accessing %gr0 when raising exception
|
From: |
deller |
|
Subject: |
[PATCH 8/9] target/hppa: Avoid accessing %gr0 when raising exception |
|
Date: |
Thu, 4 Jan 2024 19:36:27 +0100 |
From: Helge Deller <deller@gmx.de>
The value of unwind_breg may reference register %r0, but we need to avoid
accessing gr0 directly and use the value 0 instead.
At runtime I've seen unwind_breg being zero with the Linux kernel when
rfi is used to jump to smp_callin().
Signed-off-by: Helge Deller <deller@gmx.de>
---
target/hppa/mem_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index 011b192406..42bd0063c0 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -335,7 +335,7 @@ raise_exception_with_ior(CPUHPPAState *env, int excp,
uintptr_t retaddr,
cpu_restore_state(cs, retaddr);
- b = env->gr[env->unwind_breg];
+ b = env->unwind_breg ? env->gr[env->unwind_breg] : 0;
b >>= (env->psw & PSW_W ? 62 : 30);
env->cr[CR_IOR] |= b << 62;
--
2.43.0
- [PATCH 2/9] hw/hppa/machine: Disable default devices with --nodefaults option, (continued)
- [PATCH 2/9] hw/hppa/machine: Disable default devices with --nodefaults option, deller, 2024/01/04
- [PATCH 3/9] hw/pci-host/astro: Add missing astro & elroy registers for NetBSD, deller, 2024/01/04
- [PATCH 4/9] target/hppa: Fix PDC address translation on PA2.0 with PSW.W=0, deller, 2024/01/04
- [PATCH 7/9] hw/hppa: Move software power button address back into PDC, deller, 2024/01/04
- [PATCH 1/9] hw/hppa/machine: Allow up to 3840 MB total memory, deller, 2024/01/04
- [PATCH 6/9] target/hppa: Strip upper 32-bits of IOR on unaligned access error, deller, 2024/01/04
- [PATCH 8/9] target/hppa: Avoid accessing %gr0 when raising exception,
deller <=
- [PATCH 9/9] target/hppa: Update SeaBIOS-hppa to version 14, deller, 2024/01/04
- Re: [PATCH 0/9] target/hppa qemu v8.2 regression fixes, Michael Tokarev, 2024/01/04
- Re: [PATCH 0/9] target/hppa qemu v8.2 regression fixes, Michael Tokarev, 2024/01/04