diff options
author | Dylan Reid <dgreid@chromium.org> | 2018-09-17 14:42:59 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-01 11:30:02 -0700 |
commit | 9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8 (patch) | |
tree | 7dac5284094111cfa1172213436dd42cf63609ca /arch/src/lib.rs | |
parent | 90c6ad029f8cf235adf8fea571e619fb8421b887 (diff) | |
download | crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.tar crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.tar.gz crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.tar.bz2 crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.tar.lz crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.tar.xz crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.tar.zst crosvm-9f2bbc8a919330c3fb194f02cf8338dcad6ac6e8.zip |
devices: pci: fix registration of PCI IRQs
MPTABLE needs the PCI device number, not the IRQ; modify the information passed via pci_irqs so that it contains a (device index, interrupt pin) tuple. Change-Id: Ia1dcb478cdab6654087925093ef9d1204edb21c9 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1237362 Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'arch/src/lib.rs')
-rw-r--r-- | arch/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/src/lib.rs b/arch/src/lib.rs index afea720..f83e404 100644 --- a/arch/src/lib.rs +++ b/arch/src/lib.rs @@ -157,8 +157,11 @@ pub fn generate_pci_root(devices: Vec<(Box<PciDevice + 'static>, Minijail)>, 3 => PciInterruptPin::IntD, _ => panic!(""), // Obviously not possible, but the compiler is not smart enough. }; + vm.register_irqfd(&irqfd, irq_num) + .map_err(DeviceRegistrationError::RegisterIrqfd)?; + keep_fds.push(irqfd.as_raw_fd()); device.assign_irq(irqfd, irq_num, pci_irq_pin); - pci_irqs.push((irq_num, pci_irq_pin)); + pci_irqs.push((dev_idx as u32, pci_irq_pin)); let ranges = device .allocate_io_bars(resources) |