Crash by NULL pointer dereference on microvm with pic=off
Hi, I experienced a crash in `pic_read_irq()`, as it apparently tries to access a PIC state structure that is NULL. The crash was in `pic_read_irq` called from the IOAPIC interrupt delivery path using a microvm with `pic=off`, the PIC object may be NULL or uninitialized when the IOAPIC delivers an interrupt in "ExtINT" mode. The crash does not appear with `pic=on`. To reproduce 2 writes are sufficient: ``` reg.Write(0xfec00000, 0x10) reg.Write(0xfec00010, 0x700) ``` Crash dump information: ``` Stack trace of thread 25485: #0 0x0000555e3c718484 n/a (/usr/bin/qemu-system-x86_64 + 0x31b484) #1 0x0000555e3c71f529 pic_read_irq (/usr/bin/qemu-system-x86_64 + 0x322529) ... #7 0x0000555e3c894e34 memory_region_dispatch_write (/usr/bin/qemu-system-x86_64 + 0x497e34) ```
issue