[PATCH 09/11] target/hppa: Fix TOC handler for 64-bit CPUs

Helge Deller posted 11 patches 2 days, 3 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>
[PATCH 09/11] target/hppa: Fix TOC handler for 64-bit CPUs
Posted by Helge Deller 2 days, 3 hours ago
From: Helge Deller <deller@gmx.de>

When the TOC handler is triggered, e.g. by using the "NMI" command
in the QEMU monitor, make sure to call the full 64-bit TOC handler
address in SeaBIOS-hppa firmware.
This fixes the TOC handler on 64-bit CPUs (and 64-bit SeaBIOS).

Signed-off-by: Helge Deller <deller@gmx.de>
---
 target/hppa/int_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c
index d5a20cd549..fd4b99069e 100644
--- a/target/hppa/int_helper.c
+++ b/target/hppa/int_helper.c
@@ -203,7 +203,8 @@ void hppa_cpu_do_interrupt(CPUState *cs)
 
     /* step 7 */
     if (i == EXCP_TOC) {
-        env->iaoq_f = hppa_form_gva(env, 0, FIRMWARE_START);
+        env->iaoq_f = hppa_form_gva(env, 0,
+                ((uint64_t) FIRMWARE_HIGH) << 32 | FIRMWARE_START);
         /* help SeaBIOS and provide iaoq_b and iasq_back in shadow regs */
         env->gr[24] = env->cr_back[0];
         env->gr[25] = env->cr_back[1];
-- 
2.53.0
Re: [PATCH 09/11] target/hppa: Fix TOC handler for 64-bit CPUs
Posted by Philippe Mathieu-Daudé 2 days, 3 hours ago
On 30/3/26 23:18, Helge Deller wrote:
> From: Helge Deller <deller@gmx.de>
> 
> When the TOC handler is triggered, e.g. by using the "NMI" command
> in the QEMU monitor, make sure to call the full 64-bit TOC handler
> address in SeaBIOS-hppa firmware.
> This fixes the TOC handler on 64-bit CPUs (and 64-bit SeaBIOS).
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   target/hppa/int_helper.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c
> index d5a20cd549..fd4b99069e 100644
> --- a/target/hppa/int_helper.c
> +++ b/target/hppa/int_helper.c
> @@ -203,7 +203,8 @@ void hppa_cpu_do_interrupt(CPUState *cs)
>   
>       /* step 7 */
>       if (i == EXCP_TOC) {
> -        env->iaoq_f = hppa_form_gva(env, 0, FIRMWARE_START);
> +        env->iaoq_f = hppa_form_gva(env, 0,
> +                ((uint64_t) FIRMWARE_HIGH) << 32 | FIRMWARE_START);

Maybe we can define that directly and use? Such PDC_FIRMWARE_START?

Or have some hppa_pdc_addr() helper?

>           /* help SeaBIOS and provide iaoq_b and iasq_back in shadow regs */
>           env->gr[24] = env->cr_back[0];
>           env->gr[25] = env->cr_back[1];