Skip to content

Commit 296aa26

Browse files
sean-jcbonzini
authored andcommitted
KVM: VMX: Pass desired vector instead of bool for triggering posted IRQ
Refactor the posted interrupt helper to take the desired notification vector instead of a bool so that the callers are self-documenting. No functional change intended. Signed-off-by: Sean Christopherson <[email protected]> Reviewed-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 0f65a9d commit 296aa26

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3932,11 +3932,9 @@ static void vmx_msr_filter_changed(struct kvm_vcpu *vcpu)
39323932
}
39333933

39343934
static inline bool kvm_vcpu_trigger_posted_interrupt(struct kvm_vcpu *vcpu,
3935-
bool nested)
3935+
int pi_vec)
39363936
{
39373937
#ifdef CONFIG_SMP
3938-
int pi_vec = nested ? POSTED_INTR_NESTED_VECTOR : POSTED_INTR_VECTOR;
3939-
39403938
if (vcpu->mode == IN_GUEST_MODE) {
39413939
/*
39423940
* The vector of interrupt to be delivered to vcpu had
@@ -3997,7 +3995,7 @@ static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu,
39973995
smp_mb__after_atomic();
39983996

39993997
/* the PIR and ON have been set by L1. */
4000-
if (!kvm_vcpu_trigger_posted_interrupt(vcpu, true))
3998+
if (!kvm_vcpu_trigger_posted_interrupt(vcpu, POSTED_INTR_NESTED_VECTOR))
40013999
kvm_vcpu_wake_up(vcpu);
40024000
return 0;
40034001
}
@@ -4035,7 +4033,7 @@ static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector)
40354033
* guaranteed to see PID.ON=1 and sync the PIR to IRR if triggering a
40364034
* posted interrupt "fails" because vcpu->mode != IN_GUEST_MODE.
40374035
*/
4038-
if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false))
4036+
if (!kvm_vcpu_trigger_posted_interrupt(vcpu, POSTED_INTR_VECTOR))
40394037
kvm_vcpu_wake_up(vcpu);
40404038

40414039
return 0;

0 commit comments

Comments
 (0)