* [PULL 0/2] Hppa v9.1 fixes patches
@ 2024-09-04 10:14 deller
2024-09-04 10:14 ` [PULL 1/2] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64 deller
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: deller @ 2024-09-04 10:14 UTC (permalink / raw)
To: Richard Henderson, qemu-devel, Peter Maydell; +Cc: deller
From: Helge Deller <deller@gmx.de>
The following changes since commit fd1952d814da738ed107e05583b3e02ac11e88ff:
Update version for v9.1.0 release (2024-09-03 09:18:26 -0700)
are available in the Git repository at:
https://github.com/hdeller/qemu-hppa.git tags/hppa-v9.1-fixes-pull-request
for you to fetch changes up to d33d3adb573794903380e03e767e06470514cefe:
target/hppa: Fix random 32-bit linux-user crashes (2024-09-03 22:08:22 +0200)
----------------------------------------------------------------
hppa target fixes
Two important patches for the hppa target which missed qemu-v9.1:
- One fix for random linux-user crashes
- One fix for random issues due to loosing the division V-bit
during delivery of hardware interrupts. This triggers all sorts
of random faults when running in system mode.
Helge
----------------------------------------------------------------
Helge Deller (2):
target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64
target/hppa: Fix random 32-bit linux-user crashes
target/hppa/cpu.h | 4 ++--
target/hppa/helper.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--
2.46.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [PULL 1/2] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64
2024-09-04 10:14 [PULL 0/2] Hppa v9.1 fixes patches deller
@ 2024-09-04 10:14 ` deller
2024-09-04 10:14 ` [PULL 2/2] target/hppa: Fix random 32-bit linux-user crashes deller
2024-09-05 10:26 ` [PULL 0/2] Hppa v9.1 fixes patches Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: deller @ 2024-09-04 10:14 UTC (permalink / raw)
To: Richard Henderson, qemu-devel, Peter Maydell; +Cc: deller
From: Helge Deller <deller@gmx.de>
While adding hppa64 support, the psw_v variable got extended from 32 to 64
bits. So, when packaging the PSW-V bit from the psw_v variable for interrupt
processing, check bit 31 instead the 63th (sign) bit.
This fixes a hard to find Linux kernel boot issue where the loss of the PSW-V
bit due to an ITLB interruption in the middle of a series of ds/addc
instructions (from the divU milicode library) generated the wrong division
result and thus triggered a Linux kernel crash.
Link: https://lore.kernel.org/lkml/718b8afe-222f-4b3a-96d3-93af0e4ceff1@roeck-us.net/
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 931adff31478 ("target/hppa: Update cpu_hppa_get/put_psw for hppa64")
Cc: qemu-stable@nongnu.org # v8.2+
---
target/hppa/cpu.h | 2 +-
target/hppa/helper.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 2bcb3b602b..5478b183dc 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -211,7 +211,7 @@ typedef struct CPUArchState {
uint32_t psw; /* All psw bits except the following: */
uint32_t psw_xb; /* X and B, in their normal positions */
target_ulong psw_n; /* boolean */
- target_long psw_v; /* in most significant bit */
+ target_long psw_v; /* in bit 31 */
/* Splitting the carry-borrow field into the MSB and "the rest", allows
* for "the rest" to be deleted when it is unused, but the MSB is in use.
diff --git a/target/hppa/helper.c b/target/hppa/helper.c
index b79ddd8184..d4b1a3cd5a 100644
--- a/target/hppa/helper.c
+++ b/target/hppa/helper.c
@@ -53,7 +53,7 @@ target_ulong cpu_hppa_get_psw(CPUHPPAState *env)
}
psw |= env->psw_n * PSW_N;
- psw |= (env->psw_v < 0) * PSW_V;
+ psw |= ((env->psw_v >> 31) & 1) * PSW_V;
psw |= env->psw | env->psw_xb;
return psw;
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PULL 2/2] target/hppa: Fix random 32-bit linux-user crashes
2024-09-04 10:14 [PULL 0/2] Hppa v9.1 fixes patches deller
2024-09-04 10:14 ` [PULL 1/2] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64 deller
@ 2024-09-04 10:14 ` deller
2024-09-05 10:26 ` [PULL 0/2] Hppa v9.1 fixes patches Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: deller @ 2024-09-04 10:14 UTC (permalink / raw)
To: Richard Henderson, qemu-devel, Peter Maydell; +Cc: deller
From: Helge Deller <deller@gmx.de>
The linux-user hppa target crashes randomly for me since commit
081a0ed188d8 ("target/hppa: Do not mask in copy_iaoq_entry").
That commit dropped the masking of the IAOQ addresses while copying them
from other registers and instead keeps them with all 64 bits up until
the full gva is formed with the help of hppa_form_gva_psw().
So, when running in linux-user mode on an emulated 64-bit CPU, we need
to mask to a 32-bit address space at the very end in hppa_form_gva_psw()
if the PSW-W flag isn't set (which is the case for linux-user on hppa).
Fixes: 081a0ed188d8 ("target/hppa: Do not mask in copy_iaoq_entry")
Cc: qemu-stable@nongnu.org # v9.1+
Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/cpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 5478b183dc..43074d80bf 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -319,7 +319,7 @@ static inline target_ulong hppa_form_gva_psw(target_ulong psw, uint64_t spc,
target_ulong off)
{
#ifdef CONFIG_USER_ONLY
- return off;
+ return off & gva_offset_mask(psw);
#else
return spc | (off & gva_offset_mask(psw));
#endif
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PULL 0/2] Hppa v9.1 fixes patches
2024-09-04 10:14 [PULL 0/2] Hppa v9.1 fixes patches deller
2024-09-04 10:14 ` [PULL 1/2] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64 deller
2024-09-04 10:14 ` [PULL 2/2] target/hppa: Fix random 32-bit linux-user crashes deller
@ 2024-09-05 10:26 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2024-09-05 10:26 UTC (permalink / raw)
To: deller; +Cc: Richard Henderson, qemu-devel, deller
On Wed, 4 Sept 2024 at 11:14, <deller@kernel.org> wrote:
>
> From: Helge Deller <deller@gmx.de>
>
> The following changes since commit fd1952d814da738ed107e05583b3e02ac11e88ff:
>
> Update version for v9.1.0 release (2024-09-03 09:18:26 -0700)
>
> are available in the Git repository at:
>
> https://github.com/hdeller/qemu-hppa.git tags/hppa-v9.1-fixes-pull-request
>
> for you to fetch changes up to d33d3adb573794903380e03e767e06470514cefe:
>
> target/hppa: Fix random 32-bit linux-user crashes (2024-09-03 22:08:22 +0200)
>
> ----------------------------------------------------------------
> hppa target fixes
>
> Two important patches for the hppa target which missed qemu-v9.1:
> - One fix for random linux-user crashes
> - One fix for random issues due to loosing the division V-bit
> during delivery of hardware interrupts. This triggers all sorts
> of random faults when running in system mode.
>
> Helge
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/9.2
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-05 10:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 10:14 [PULL 0/2] Hppa v9.1 fixes patches deller
2024-09-04 10:14 ` [PULL 1/2] target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64 deller
2024-09-04 10:14 ` [PULL 2/2] target/hppa: Fix random 32-bit linux-user crashes deller
2024-09-05 10:26 ` [PULL 0/2] Hppa v9.1 fixes patches Peter Maydell
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).