diff options
author | James Sullivan <sullivan.james.f@gmail.com> | 2015-03-19 02:26:04 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-07 11:29:45 +0200 |
commit | d1ebdbf99a3ce90f3b886c2cf0dfd7da17703d2a (patch) | |
tree | dc8aeb229f4347806c72a48473e5f18cfc43831b /arch/x86/kvm/lapic.h | |
parent | kvm: x86: Extended struct kvm_lapic_irq with msi_redir_hint for MSI delivery (diff) | |
download | linux-d1ebdbf99a3ce90f3b886c2cf0dfd7da17703d2a.tar.xz linux-d1ebdbf99a3ce90f3b886c2cf0dfd7da17703d2a.zip |
kvm: x86: Deliver MSI IRQ to only lowest prio cpu if msi_redir_hint is true
An MSI interrupt should only be delivered to the lowest priority CPU
when it has RH=1, regardless of the delivery mode. Modified
kvm_is_dm_lowest_prio() to check for either irq->delivery_mode == APIC_DM_LOWPRI
or irq->msi_redir_hint.
Moved kvm_is_dm_lowest_prio() into lapic.h and renamed to
kvm_lowest_prio_delivery().
Changed a check in kvm_irq_delivery_to_apic_fast() from
irq->delivery_mode == APIC_DM_LOWPRI to kvm_is_dm_lowest_prio().
Signed-off-by: James Sullivan <sullivan.james.f@gmail.com>
Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | arch/x86/kvm/lapic.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 793f76183e8b..71b150cae5f9 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -153,6 +153,12 @@ static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu) return vcpu->arch.apic->pending_events; } +static inline bool kvm_lowest_prio_delivery(struct kvm_lapic_irq *irq) +{ + return (irq->delivery_mode == APIC_DM_LOWEST || + irq->msi_redir_hint); +} + bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector); void wait_lapic_expire(struct kvm_vcpu *vcpu); |