[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/19] ppc/vhyp: reset exception state when handling vhyp hcal
From: |
Nicholas Piggin |
Subject: |
[PATCH v2 01/19] ppc/vhyp: reset exception state when handling vhyp hcall |
Date: |
Tue, 8 Aug 2023 14:19:43 +1000 |
Convention is to reset the exception_index and error_code after handling
an interrupt. The vhyp hcall handler fails to do this. This does not
appear to have ill effects because cpu_handle_exception() clears
exception_index later, but it is fragile and inconsistent. Reset the
exception state after handling vhyp hcall like other handlers.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/excp_helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 32e46e56b3..72ec2be92e 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -843,6 +843,7 @@ static void powerpc_excp_7xx(PowerPCCPU *cpu, int excp)
PPCVirtualHypervisorClass *vhc =
PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp);
vhc->hypercall(cpu->vhyp, cpu);
+ powerpc_reset_excp_state(cpu);
return;
}
@@ -1014,6 +1015,7 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp)
PPCVirtualHypervisorClass *vhc =
PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp);
vhc->hypercall(cpu->vhyp, cpu);
+ powerpc_reset_excp_state(cpu);
return;
}
@@ -1526,6 +1528,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
PPCVirtualHypervisorClass *vhc =
PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp);
vhc->hypercall(cpu->vhyp, cpu);
+ powerpc_reset_excp_state(cpu);
return;
}
if (env->insns_flags2 & PPC2_ISA310) {
--
2.40.1
- [PATCH v2 for-8.2 00/19] ppc: record-replay enablement and fixes, Nicholas Piggin, 2023/08/08
- [PATCH v2 01/19] ppc/vhyp: reset exception state when handling vhyp hcall,
Nicholas Piggin <=
- [PATCH v2 02/19] ppc/vof: Fix missed fields in VOF cleanup, Nicholas Piggin, 2023/08/08
- [PATCH v2 03/19] hw/ppc/ppc.c: Tidy over-long lines, Nicholas Piggin, 2023/08/08
- [PATCH v2 04/19] hw/ppc: Introduce functions for conversion between timebase and nanoseconds, Nicholas Piggin, 2023/08/08
- [PATCH v2 05/19] host-utils: Add muldiv64_round_up, Nicholas Piggin, 2023/08/08
- [PATCH v2 06/19] hw/ppc: Round up the decrementer interval when converting to ns, Nicholas Piggin, 2023/08/08
- [PATCH v2 07/19] hw/ppc: Avoid decrementer rounding errors, Nicholas Piggin, 2023/08/08
- [PATCH v2 08/19] target/ppc: Sign-extend large decrementer to 64-bits, Nicholas Piggin, 2023/08/08
- [PATCH v2 09/19] hw/ppc: Always store the decrementer value, Nicholas Piggin, 2023/08/08
- [PATCH v2 10/19] target/ppc: Migrate DECR SPR, Nicholas Piggin, 2023/08/08