]> xenbits.xensource.com Git - xen.git/commit
tools/libxl: Skip invalid IRQs
authorJason Andryuk <jason.andryuk@amd.com>
Fri, 18 Apr 2025 21:05:49 +0000 (17:05 -0400)
committerAnthony PERARD <anthony.perard@vates.tech>
Fri, 25 Apr 2025 09:44:48 +0000 (11:44 +0200)
commitec9fda045b517128e2173fa7b87bf6aee9dcc33a
tree2bb6a54639cb64ae814c2547f60b76ae9eba5877
parenta5d0e9c901044055c1c412d0825b434f21ec273e
tools/libxl: Skip invalid IRQs

A PCI device's irq field is an 8-bit number.  A value of 0xff indicates
that the device IRQ is not connected.  Additionally, the Linux ACPI code
can convert these 0xff values to IRQ_NOTCONNECTED(0x80000000) because
"0x80000000 is guaranteed to be outside the available range of
interrupts and easy to distinguish from other possible incorrect
values."  When the hypercall to assign that IRQ fails, device
passthrough as a whole fails.

Add checking for a valid IRQ and skip the IRQ handling for PCI devices
outside that range.  This allows for passthrough of devices without
legacy IRQs.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
tools/libs/light/libxl_pci.c