From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C28D4396B63 for ; Tue, 14 Apr 2026 23:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776208202; cv=none; b=XaPdUyC01ptU1PeIHd6FORB2vpph8i5yCMYxGQwjh0YwWULBJRaiYzoE6aNDuTLzuzwC/dePlRhCCTsTWqbHgj/+Px/mde6LoUWW+RHNm346Iaps+OHwiL4XUuj/P3Ve1vQAaiVx+q0BpZyGQggoq6HK1wDaOoeI8EhiiRlPiDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776208202; c=relaxed/simple; bh=Ti0eH8QYmvNOIG5mEeKlxqSXlZkgN/SXT3ext+JPO50=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hboabJx6ybeu2MqH6Flx5CMKRPqA3ZZ7NnY2elaiHqyk9GoDWJoe32qfE5Wq3nm9Ccg1vqNFLmpvZQl6KeUemxEINCTg9ugdkVc0uQju2Mlzh3kLDbeOpUvyj+jQdms4c3xh/pOCMBaYTdNO025OUYp6RO+La/8YGFxO0bu1IjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jrhilke.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sUUq5uvK; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jrhilke.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sUUq5uvK" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c76b6db8bb2so3680573a12.3 for ; Tue, 14 Apr 2026 16:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776208200; x=1776813000; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=6tyMCul/EATFzu5RH7kOm34+Xt8EDd3MjMu/N9tmcUY=; b=sUUq5uvKAceb4FQGfMnIdKlC1DdUKU9I/SwR14UaX4GXyh2kX/cU4gdS5i/E8IFogX 4y3yuJZ6mhbpTPpFrPc3A2skZEt7AFmGwTmFn2IAjBW3FIvHGjU9Lv0GnkP0XITUUqQ4 /hVCKX0k8KqVamtCaAi4V99WHmbyw1EvXNOXDWnWALPS7i1wXmXgXhWK+cX5Bnvv71Hz O21gY8igFCx6S3ZmoXSjzCWcPiKY3W50ydcGNl65PtITTBQnua0RO1LAGJ7ojk0yEfmE MwbES6JmwpuB75WqdLBN9g+d/l3rrlQOB2FX4TAtPgXdtrbgRmd3r6PKZ+3YnKVCfNl9 zpvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776208200; x=1776813000; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6tyMCul/EATFzu5RH7kOm34+Xt8EDd3MjMu/N9tmcUY=; b=Q0xVp7EzbImGyA+UF9sxhxrlUnH4n5Q9x2CYGcE/SEEKJRUBjN+frhpYXHiVADqFPg fl2L6UQAuZMJ7viBH67gtoyfWG7ERIfP+fVJ8SvjPio2t7KAwjBcd/Ho01yD+bSf8t0U jkqwPxKrLTLTB7fQvyDWWLZEL/cqUUPMEum8jSgSuiB+jzVEX8wqI0c5GrF3yw8O4E+/ 8E89iejPVKzDoNqyAP3cX42oRcNk6lgEVJrkxUd7sKc1ZbtH4LnpDoQKhzFPrx+Yx/uN +blAvPXkaXByAU2ljsZWtdm9lD4Q7rZ0JFVdPsohhsMmd+SQEJQHJgqOIQ7YVypIDAwA gnQg== X-Forwarded-Encrypted: i=1; AFNElJ/B9ZKdGwJ7H2xUfN7nHSKSNnArs2zJj7QXB7qKRKkPLtEYWZiacqqvLTw2Iz5z3072dcgG2N1wcSc0dfo=@vger.kernel.org X-Gm-Message-State: AOJu0YxZcewOULUnYsZG0xxUUI5GyofVPlIbNG7QB9kYmooP7tFJpjwr enROwGJMXWxNnkT6vlkiLcNf+/PBeZKHJB7yQ16a3S1rlu0/a/HcHcfYQMcjPejqGmAe/icXe3I cCx69Pd6X X-Received: from pfav10.prod.google.com ([2002:a05:6a00:ab0a:b0:82f:805:b62a]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:4307:b0:39c:14b3:6234 with SMTP id adf61e73a8af0-39fe3cf22a2mr20150560637.15.1776208199906; Tue, 14 Apr 2026 16:09:59 -0700 (PDT) Date: Tue, 14 Apr 2026 23:09:43 +0000 In-Reply-To: <20260414230943.41198-1-jrhilke@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260414230943.41198-1-jrhilke@google.com> X-Mailer: git-send-email 2.54.0.rc0.605.g598a273b03-goog Message-ID: <20260414230943.41198-2-jrhilke@google.com> Subject: [PATCH v2 1/1] vfio: selftests: Find devices that have VFIO selftest drivers From: Josh Hilke To: Alex Williamson Cc: Sean Christopherson , David Matlack , Vipin Sharma , Raghavendra Rao Ananta , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Hilke Content-Type: text/plain; charset="UTF-8" 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 Suggested-by: Sean Christopherson --- 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=( + "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