diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2023-05-30 23:21:27 +1000 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2023-06-11 11:14:51 +0300 |
commit | 8e57e02ff8f655a0fca6877299e26454cc2d1165 (patch) | |
tree | fc683dd34a520779a9757689a2462a93d8f45a49 | |
parent | d31e0a384391c072bb121816ce9b7582a65cad9d (diff) | |
download | qemu-8e57e02ff8f655a0fca6877299e26454cc2d1165.zip qemu-8e57e02ff8f655a0fca6877299e26454cc2d1165.tar.gz qemu-8e57e02ff8f655a0fca6877299e26454cc2d1165.tar.bz2 |
target/ppc: Fix nested-hv HEAI delivery
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>
(cherry picked from commit 6c242e79b876b3570b8fd2f10f2a502467758e56)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r-- | target/ppc/excp_helper.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 30bc2e6..6cf88f6 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; } |