Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: "David Matlack" <dmatlack@google.com>
To: "Josh Hilke" <jrhilke@google.com>, "Alex Williamson" <alex@shazbot.org>
Cc: "David Matlack" <dmatlack@google.com>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Sean Christopherson" <seanjc@google.com>,
	"Vipin Sharma" <vipinsh@google.com>
Subject: Re: [PATCH v8] vfio: selftests: Find devices that have VFIO selftest drivers
Date: Wed, 18 Nov 2026 16:43:07 -0800	[thread overview]
Message-ID: <DMYRRCPO4FL8.HP2LYDQ286E0@google.com> (raw)
In-Reply-To: <20261118064309.219592-1-jrhilke@google.com>

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.

      reply	other threads:[~2026-11-19  0:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  6:43 [PATCH v8] vfio: selftests: Find devices that have VFIO selftest drivers Josh Hilke
2026-11-19  0:43 ` David Matlack [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DMYRRCPO4FL8.HP2LYDQ286E0@google.com \
    --to=dmatlack@google.com \
    --cc=alex@shazbot.org \
    --cc=jrhilke@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=vipinsh@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox