All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Matlack <dmatlack@google.com>
To: Josh Hilke <jrhilke@google.com>
Cc: Alex Williamson <alex@shazbot.org>,
	Sean Christopherson <seanjc@google.com>,
	Vipin Sharma <vipinsh@google.com>,
	Raghavendra Rao Ananta <rananta@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] vfio: selftests: Find devices that have VFIO selftest drivers
Date: Thu, 16 Apr 2026 23:35:00 +0000	[thread overview]
Message-ID: <aeFyJBjmJ3jYB02q@google.com> (raw)
In-Reply-To: <20260414230943.41198-2-jrhilke@google.com>

On 2026-04-14 11:09 PM, Josh Hilke wrote:
> Add a new script, list_devices.sh, which prints out the
> segment:bus:device.function numbers of devices on a machine that have a VFIO
> selftest driver. This makes it easier to determine if the system is capable of
> running VFIO selftests, because devices that have a VFIO selftest driver are
> compatible with all VFIO selftests.
> 
> Example:
> $ ./tools/testing/selftests/vfio/scripts/list_devices.sh
> 0000:6a:01.0
> 0000:6f:01.0
> 0000:74:01.0
> 
> Signed-off-by: Josh Hilke <jrhilke@google.com>
> Suggested-by: Sean Christopherson <seanjc@google.com>

Aside the nit below, looks good to me. But would like to get Sean's
feedback too since he requested it.

Reviewed-by: David Matlack <dmatlack@google.com>

> ---
>  tools/testing/selftests/vfio/Makefile         |  1 +
>  .../selftests/vfio/scripts/list_devices.sh    | 22 +++++++++++++++++++
>  2 files changed, 23 insertions(+)
>  create mode 100755 tools/testing/selftests/vfio/scripts/list_devices.sh
> 
> diff --git a/tools/testing/selftests/vfio/Makefile b/tools/testing/selftests/vfio/Makefile
> index 8e90e409e91d..d48ac967f1dc 100644
> --- a/tools/testing/selftests/vfio/Makefile
> +++ b/tools/testing/selftests/vfio/Makefile
> @@ -15,6 +15,7 @@ TEST_GEN_PROGS += vfio_pci_driver_test
>  
>  TEST_FILES += scripts/cleanup.sh
>  TEST_FILES += scripts/lib.sh
> +TEST_FILES += scripts/list_devices.sh
>  TEST_FILES += scripts/run.sh
>  TEST_FILES += scripts/setup.sh
>  
> diff --git a/tools/testing/selftests/vfio/scripts/list_devices.sh b/tools/testing/selftests/vfio/scripts/list_devices.sh
> new file mode 100755
> index 000000000000..b56fa23d5657
> --- /dev/null
> +++ b/tools/testing/selftests/vfio/scripts/list_devices.sh
> @@ -0,0 +1,22 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +# List of devices which have a VFIO selftest driver
> +DEVICES=(

nit: Use readonly here.

> +	"8086:0b25" # Intel SPR DSA
> +	"8086:11fb" # Intel GNR-D DSA
> +	"8086:1212" # Intel DR DSA
> +	"8086:0cf8" # Intel CBDMA
> +)
> +
> +# Print the segment:bus:device.function numbers of PCI devices that can be used
> +# to run VFIO selftests.
> +function main() {
> +	local vendor_device_id
> +
> +	for vendor_device_id in "${DEVICES[@]}"; do
> +		lspci -D -d "${vendor_device_id}" | awk '{print $1}'
> +	done
> +}
> +
> +main "$@"
> -- 
> 2.54.0.rc0.605.g598a273b03-goog
> 

  reply	other threads:[~2026-04-16 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14 23:09 [PATCH v2 0/1] vfio: selftests: Find devices that have VFIO selftest drivers Josh Hilke
2026-04-14 23:09 ` [PATCH v2 1/1] " Josh Hilke
2026-04-16 23:35   ` David Matlack [this message]
2026-05-08 18:17   ` Sean Christopherson
2026-05-08 22:03     ` Josh Hilke
2026-05-08 22:20       ` Sean Christopherson
2026-05-08 22:49         ` David Matlack
2026-05-11 16:12           ` Josh Hilke

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=aeFyJBjmJ3jYB02q@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=rananta@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.