Re: [PATCH v8] vfio: selftests: Find devices that have VFIO selftest drivers

From: David Matlack

Date: Wed Nov 18 2026 - 19:43:27 EST


On Tue Nov 17, 2026 at 10:43 PM PST, Josh Hilke wrote:
> +# Devices that have a driver in selftests/vfio/lib/drivers.
> +readonly DEVICES=(
> + "8086:0b25,Intel DSA SPR"
> [...]
> + "15b3:a2df,Mellanox BlueField-4 integrated ConnectX-8"
> +)

This is missing GPUs that are supported by the nv_falcon driver.

I saw in the v7 changelog that you left them out because
nv_falcon_probe() matches on PMC_BOOT_0 rather than PCI ID. But the
first thing nv_falcon_probe() does is check vendor == 0x10de and base
class == PCI_BASE_CLASS_DISPLAY, and the script can get both of those
from sysfs. And past that, nv_falcon_probe() only rejects GPUs with an
unknown architecture; unverified GPUs are accepted with a "possibly not
supported" message. So matching on vendor and class gets the script
about as close as the driver itself gets.

e.g. something like:

read -r class < /sys/bus/pci/devices/${bdf}/class
if [ "${vendor}" = "0x10de" ] && [ $((class >> 16)) -eq 3 ]; then
...
fi

Also, nv_falcon does not implement send_msi(), so on NVIDIA GPUs the
send_msi tests in vfio_pci_driver_test are skipped and kvm/irq_test
does not run at all. The script should make this clear when it reports
an NVIDIA GPU so users know they're getting reduced coverage.

Since the script can't check the GPU architecture itself, it would also
help to tell the user which architectures nv_falcon supports, so they
can check their GPU themselves. e.g. something like:

Supported:
0000:00:04.0 - Intel IOAT SKX [8086:2021]

Possibly supported (depends on GPU architecture):
0000:3b:00.0 - NVIDIA GPU [10de:1eb8]

nv_falcon supports Kepler, Maxwell, Pascal, Volta, Turing, Ampere,
Ada, and Hopper GPUs. It does not support send_msi().

Please add a comment next to the list of architectures pointing at
nv_gpu_arch_lookup() so the two stay in sync.

I think it's fine to include these GPUs in the -q output. If the GPU
turns out to be unsupported, vfio_pci_driver_test will just skip.

Printing the selftest driver name for each device might also help
here, and would make it easier to tie the list back to lib/drivers/.

> +function vfio_pci_loaded() {
> + [ -d ${VFIO_PCI_DRIVER} ]
> +}
> +
> +function denylisted() {
> [...]
> +function denylist_enforced() {
> [...]
> +function is_blocked() {

Please consistently use is_*() for functions that check a condition,
e.g. is_vfio_pci_loaded(), is_denylisted(), is_denylist_enforced(), and
is_blocked(). That makes call sites like this one read more clearly:

if [ "${all}" ] || ! is_blocked ${id}; then

> + if [ ${#allowed_devices[@]} -gt 0 ]; then
> + print_allowed_devices "${allowed_devices[@]}"
> + fi
> +
> + if [ ${#denylisted_devices[@]} -gt 0 ]; then
> + print_denylisted_devices "${denylisted_devices[@]}"
> + fi

nit: When both groups have devices, there's no blank line between the
last "Supported:" entry and the "Unusable ...:" header, which makes the
output harder to scan.