Skip to content

Commit df938a5

Browse files
iamjpnmpe
authored andcommitted
KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts
There is no need to inject an external interrupt in kvmppc_book3s_irqprio_deliver() as the test for BOOK3S_IRQPRIO_EXTERNAL in kvmhv_run_single_vcpu() before guest entry will raise LPCR_MER if needed. There is also no need to inject the decrementer interrupt as this will be raised within the L2 if needed. Avoiding these injections reduces H_GUEST_GET_STATE hcalls by the L1. Suggested-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231201132618.555031-8-vaibhav@linux.ibm.com
1 parent ecd1070 commit df938a5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/powerpc/kvm/book3s.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ static int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu,
302302

303303
switch (priority) {
304304
case BOOK3S_IRQPRIO_DECREMENTER:
305-
deliver = (kvmppc_get_msr(vcpu) & MSR_EE) && !crit;
305+
deliver = !kvmhv_is_nestedv2() && (kvmppc_get_msr(vcpu) & MSR_EE) && !crit;
306306
vec = BOOK3S_INTERRUPT_DECREMENTER;
307307
break;
308308
case BOOK3S_IRQPRIO_EXTERNAL:
309-
deliver = (kvmppc_get_msr(vcpu) & MSR_EE) && !crit;
309+
deliver = !kvmhv_is_nestedv2() && (kvmppc_get_msr(vcpu) & MSR_EE) && !crit;
310310
vec = BOOK3S_INTERRUPT_EXTERNAL;
311311
break;
312312
case BOOK3S_IRQPRIO_SYSTEM_RESET:

0 commit comments

Comments
 (0)