Skip to content

Commit 637543a

Browse files
ssuthiku-amdbonzini
authored andcommitted
KVM: x86: Fixes posted interrupt check for IRQs delivery modes
Current logic incorrectly uses the enum ioapic_irq_destination_types to check the posted interrupt destination types. However, the value was set using APIC_DM_XXX macros, which are left-shifted by 8 bits. Fixes by using the APIC_DM_FIXED and APIC_DM_LOWEST instead. Fixes: (fdcf756 'KVM: x86: Disable posted interrupts for non-standard IRQs delivery modes') Cc: Alexander Graf <[email protected]> Signed-off-by: Suravee Suthikulpanit <[email protected]> Message-Id: <[email protected]> Reviewed-by: Maxim Levitsky <[email protected]> Tested-by: Maxim Levitsky <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7134fa0 commit 637543a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/include/asm/kvm_host.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,8 +1663,8 @@ void kvm_set_msi_irq(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e,
16631663
static inline bool kvm_irq_is_postable(struct kvm_lapic_irq *irq)
16641664
{
16651665
/* We can only post Fixed and LowPrio IRQs */
1666-
return (irq->delivery_mode == dest_Fixed ||
1667-
irq->delivery_mode == dest_LowestPrio);
1666+
return (irq->delivery_mode == APIC_DM_FIXED ||
1667+
irq->delivery_mode == APIC_DM_LOWEST);
16681668
}
16691669

16701670
static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)