diff mbox series

KVM: x86: refine delivery_mode check

Message ID 1598514889-23810-1-git-send-email-lirongqing@baidu.com (mailing list archive)
State New, archived
Headers show
Series KVM: x86: refine delivery_mode check | expand

Commit Message

Li RongQing Aug. 27, 2020, 7:54 a.m. UTC
delivery_mode of kvm_ioapic_redirect_entry, is 3 bits width
value, should be shifted 8bits when check with APIC_DM_FIXED
whose value bits are from bit 8 to bit 10. although it works
because APIC_DM_FIXED is zero

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 arch/x86/kvm/ioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index d057376bd3d3..43e23b0003d6 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -375,7 +375,7 @@  static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
 		if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG
 		    && ioapic->irr & (1 << index))
 			ioapic_service(ioapic, index, false);
-		if (e->fields.delivery_mode == APIC_DM_FIXED) {
+		if ((e->fields.delivery_mode << 8) == APIC_DM_FIXED) {
 			struct kvm_lapic_irq irq;
 
 			irq.vector = e->fields.vector;