On 2026-07-22 12:15 AM, Josh Hilke wrote:
> This v6 of a series which adds a VFIO selftest driver for the Intel
> Gigabit Ethernet controller (IGB), specifically targeting the 82576
> device. IGB is fully virtualized in QEMU, making it suitable for running
> VFIO selftests without specialized hardware.

> Testing
> =======
> - VFIO selftests builds clean at every commit
> - vfio_pci_driver_test passes using IGB driver + QEMU. Use the following
>   command to run the tests:
> 
>   vng \
>   --run arch/x86/boot/bzImage \
>   --user root \
>   --disable-microvm \
>   --memory 32G \
>   --cpus 8 \
>   --qemu-opts="-M q35,accel=kvm,kernel-irqchip=split" \
>   --qemu-opts="-device 
> intel-iommu,intremap=on,caching-mode=on,device-iotlb=on" \
>   --qemu-opts="-netdev user,id=net0 -device igb,netdev=net0,addr=09.0" \
>   --append "console=ttyS0 earlyprintk=ttyS0 intel_iommu=on iommu=pt" \
>   --exec "modprobe vfio-pci && \
>           ./tools/testing/selftests/vfio/scripts/setup.sh 0000:00:09.0 && \
>           ./tools/testing/selftests/vfio/scripts/run.sh 
> ./tools/testing/selftests/vfio/vfio_pci_driver_test"

Extending this, you can run all VFIO selftests like this:

make -C tools/testing/selftests TARGETS=vfio install
vng \
        ...
        --append="hugepagesz=2M hugepages=1 hugepagesz=1G hugepages=1" \
        --exec "
                tools/testing/selftests/vfio/scripts/setup.sh 0000:00:09.0 &&
                export VFIO_SELFTESTS_BDF=0000:00:09.0 &&
                cd tools/testing/selftests/kselftest_install &&
                ./run_kselftest.sh -o 360 -c vfio
        "

The --append flag makes sure there are HugeTLB pages allocated for
vfio_dma_mapping_test. The "-o 360" is needed because
vfio_pci_driver_test takes more than 45 seconds.

> Alex Williamson (4):
>       vfio: selftests: igb: Use PHY internal loopback on 82576
>       vfio: selftests: Add helpers to re-enable interrupts
>       vfio: selftests: igb: Factor hardware programming into igb_hw_init()
>       vfio: selftests: igb: Recover after DMA-read faults
> 
> Josh Hilke (2):
>       vfio: selftests: igb: Add driver for Intel 82576 device
>       vfio: selftests: Retry on EAGAIN during device reset

Reviewed-by: David Matlack <[email protected]>

Thanks!

Reply via email to