OSDN Git Service

hw/intc/apic: reject pic ints if isa_pic == NULL
authorSergio Lopez <slp@redhat.com>
Thu, 26 Sep 2019 12:48:00 +0000 (14:48 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Oct 2019 07:39:54 +0000 (09:39 +0200)
In apic_accept_pic_intr(), reject PIC interruptions if a i8259 PIC has
not been instantiated (isa_pic == NULL).

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
hw/intc/apic.c

index bce8991..2a74f7b 100644 (file)
@@ -610,7 +610,7 @@ int apic_accept_pic_intr(DeviceState *dev)
 
     if ((s->apicbase & MSR_IA32_APICBASE_ENABLE) == 0 ||
         (lvt0 & APIC_LVT_MASKED) == 0)
-        return 1;
+        return isa_pic != NULL;
 
     return 0;
 }