A device model saves whether it asserts its interrupt (the e1000's
esc_irq_asserted, AHCI's lintr, virtio's ISR), and the kernel saves the
assert count of the I/O APIC pin, but pi_lintr.state, which sits between
the two, was not saved. After a restore of a device that was asserting
INTx, the state was IDLE while the pin's count was 1. When the guest
then cleared the cause, pci_lintr_deassert() did nothing, as it only
deasserts from ASSERTED, and the level triggered pin stayed asserted for
good: the guest took the same interrupt again after every EOI.
Save the state with the rest of the PCI device. This changes the format
of the snapshot.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev