[PATCH] KVM: x86: refine delivery_mode check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 arch/x86/kvm/ioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.16.2




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux