Split the IRQ allocation into two PciDevice functions:
1. Ask the device if it has a preferred IRQ (used for PCI passthrough
with VFIO where we want the IRQ and pin assignment to match the
host).
2. Inform the device which IRQ it has been assigned (and providing the
interrupt event object).
This moves the decision of which pin to use into the generate_pci_root
function in arch, which means we will know the pin before assigning an
IRQ. This will be used to ensure that pin <-> IRQ number assignments are
consistent within each device in a following change.
While the API is changing, also take the opportunity to clone the IRQ
event on the caller side so that each individual device does not need to
do it.
BUG=b:3834424
TEST=Boot x86_64 Linux in crosvm
Change-Id: Ia61c108143a5bc1862e0f345c912bc0724209a72
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3840306
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on
simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security
boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t
emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as
the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.
For contribution, see the contributor guide. Mirror
repository is available at GitHub for your convenience, but
we don't accept bug reports or pull requests there.