]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: Don't mistreat edge-triggered INIT IPI as INIT de-assert. (LAPIC)
authorJulian Stecklina <js@alien8.de>
Mon, 16 Jan 2012 13:02:20 +0000 (14:02 +0100)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:43 +0000 (14:52 +0200)
If the guest programs an IPI with level=0 (de-assert) and trig_mode=0 (edge),
it is erroneously treated as INIT de-assert and ignored, but to quote the
spec: "For this delivery mode [INIT de-assert], the level flag must be set to
0 and trigger mode flag to 1."

Signed-off-by: Julian Stecklina <js@alien8.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/lapic.c

index cfdc6e0ef0025f4687c1a7b9d3c6dff42f0c8875..3ee1d83c695dc525c1292520a302795eddd0f3a1 100644 (file)
@@ -433,7 +433,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
                break;
 
        case APIC_DM_INIT:
-               if (level) {
+               if (!trig_mode || level) {
                        result = 1;
                        vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
                        kvm_make_request(KVM_REQ_EVENT, vcpu);