[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/29] target/ppc: Fix nested-hv HEAI delivery
From: |
Daniel Henrique Barboza |
Subject: |
[PULL 06/29] target/ppc: Fix nested-hv HEAI delivery |
Date: |
Sat, 10 Jun 2023 10:31:09 -0300 |
From: Nicholas Piggin <npiggin@gmail.com>
ppc hypervisors turn HEAI interrupts into program interrupts injected
into the guest that executed the illegal instruction, if the hypervisor
doesn't handle it some other way.
The nested-hv implementation failed to account for this HEAI->program
conversion. The virtual hypervisor wants to see the HEAI when running
a nested guest, so that interrupt type can be returned to its KVM
caller.
Fixes: 7cebc5db2eba6 ("target/ppc: Introduce a vhyp framework for nested HV
support")
Cc: balaton@eik.bme.hu
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20230530132127.385001-1-npiggin@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
target/ppc/excp_helper.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index fea9221501..9ffcfe788a 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -1358,9 +1358,12 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
/*
* We don't want to generate a Hypervisor Emulation Assistance
- * Interrupt if we don't have HVB in msr_mask (PAPR mode).
+ * Interrupt if we don't have HVB in msr_mask (PAPR mode),
+ * unless running a nested-hv guest, in which case the L1
+ * kernel wants the interrupt.
*/
- if (excp == POWERPC_EXCP_HV_EMU && !(env->msr_mask & MSR_HVB)) {
+ if (excp == POWERPC_EXCP_HV_EMU && !(env->msr_mask & MSR_HVB) &&
+ !books_vhyp_handles_hv_excp(cpu)) {
excp = POWERPC_EXCP_PROGRAM;
}
--
2.40.1
- [PULL 00/29] ppc queue, Daniel Henrique Barboza, 2023/06/10
- [PULL 01/29] pnv/xive2: Add definition for TCTXT Config register, Daniel Henrique Barboza, 2023/06/10
- [PULL 04/29] pnv/xive2: Introduce macros to manipulate TIMA addresses, Daniel Henrique Barboza, 2023/06/10
- [PULL 03/29] pnv/xive2: Allow writes to the Physical Thread Enable registers, Daniel Henrique Barboza, 2023/06/10
- [PULL 05/29] pnv/xive2: Handle TIMA access through all ports, Daniel Henrique Barboza, 2023/06/10
- [PULL 02/29] pnv/xive2: Add definition for the ESB cache configuration register, Daniel Henrique Barboza, 2023/06/10
- [PULL 06/29] target/ppc: Fix nested-hv HEAI delivery,
Daniel Henrique Barboza <=
- [PULL 07/29] pnv/xive2: Quiet down some error messages, Daniel Henrique Barboza, 2023/06/10
- [PULL 08/29] target/ppc: Fix PMU hflags calculation, Daniel Henrique Barboza, 2023/06/10
- [PULL 09/29] target/ppc: PMU do not clear MMCR0[FCECE] on performance monitor alert, Daniel Henrique Barboza, 2023/06/10
- [PULL 10/29] target/ppc: Fix msgclrp interrupt type, Daniel Henrique Barboza, 2023/06/10
- [PULL 11/29] target/ppc: Support directed privileged doorbell interrupt (SDOOR), Daniel Henrique Barboza, 2023/06/10
- [PULL 12/29] target/ppc: PMU implement PERFM interrupts, Daniel Henrique Barboza, 2023/06/10
- [PULL 13/29] target/ppc: Remove single use function, Daniel Henrique Barboza, 2023/06/10
- [PULL 14/29] target/ppc: Remove "ext" parameter of ppcemb_tlb_check(), Daniel Henrique Barboza, 2023/06/10
- [PULL 15/29] target/ppc: Move ppcemb_tlb_search() to mmu_common.c, Daniel Henrique Barboza, 2023/06/10
- [PULL 16/29] target/ppc: Remove some unneded line breaks, Daniel Henrique Barboza, 2023/06/10