This fixes a bug introduced by [1] when msix pba table offset is smaller than
msix table offset.
An error may occure when booting guest with some vfio devices:
[ERROR:src/panic_hook.rs:90] thread 'main' panicked at 'attempt to subtract with overflow', devices/src/pci/vfio_pci.rs:274:26
[1] 7458a3a19b
So limit the adjustment of table size only if pba table offset is greater than
table offset.
BUG=b:1971693450
TEST=passthrough a nvme which the msix table offset is greater than pba
table offset, boot and verify MSIX-capable passed-through devices work
properly.
Change-Id: I1432c2290feaa5f6db088ebd416dc346547e7952
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3279957
Reviewed-by: Tina Zhang <tina.zhang@intel.corp-partner.google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: 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.