From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 10257396B63 for ; Tue, 14 Apr 2026 23:09:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776208192; cv=none; b=u2YwJUJU0m8+x4iSSj+JEf9qoqtbJMNHnGY9k3p2ty0NhIJ6Ait0brf0c5Pky+Z6Iy4rHbMwHX7m461xM5C/Bon4cgfiymlwsElIhAHbKRKQGq1TbNNPPK3GXXqxJ3CDzVOKw5lWFOH6Dtn3INaJ3L+PobwFM+AF2YdNyCKpVkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776208192; c=relaxed/simple; bh=mSn2+CdkzvVugFjulIZ8rGM3uGs2RacYe8G6a3z1KlU=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=bJcs/DB+ggcqs6vs9EoQhg3zWsuqw3IDO7lf8m+YCXfOBj23LPpzbT2SJQged0I4tbHA2kAAYofUoJJkfeUwev+282bgYyeLJFVIn0tOnLaW9cPrfGY+C0T2X/Yo9BVz8iYV2Jc6kWGUcHBTzFwC5/kFmkiWS591uSiiwR9WKHc= 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=IFOag27/; arc=none smtp.client-ip=209.85.216.73 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="IFOag27/" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-358f058973fso6310970a91.1 for ; Tue, 14 Apr 2026 16:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776208190; x=1776812990; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=ShBtaBHkFnQMUJA+zqLc7ojYj06qndTGZpGoAm+7NGo=; b=IFOag27/0cnw1pvkg8WPF5nW5YZ3XIPZj3r4xGLPmC72chUm+j6SpcYlRwangqX7oi hvYZdHwO41QNJ7h0Mp/lSuehroWY3BQGL5fNtBTKl1SDntrIfa/MxB0UYomaJ2q05tuw Cy6wQ2CRL0HH/ZaeSoyLCEw5/6KwEtdEMY+r79Rpf9qUOMAXC1RTpuoZ+0QHQR3gu3e3 LUzunCihfwDqppXs/Bdc55lNS46lECmENcxckHKkqNN5AvP0lpL6IQwPxk4TtN1Drjwp QpqPTJ35IBKINROCdL1ZPfP6zxxT8ueouYJq9C13bSPfkkdtBi230gRmzneRWIOkFew3 aoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776208190; x=1776812990; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ShBtaBHkFnQMUJA+zqLc7ojYj06qndTGZpGoAm+7NGo=; b=A/7Vx8VQco7CfPql3/iME6VnxWg8dehhD9RYG72zWkzNEzvGYT3JlGGaVTgCF6PCRA EyBGqCOxL7o/osJqw+6mGis7gJ19zBLR6/XNFiGDbQU67/Mjh+g1KlTgAz2LfLXYwNJA zPto4X2vXuEeHqnyZaYGhDmwSKU1p4KfO7on/G46l7wMCzIgG8msMD2atNEJFkkxEtF6 ds+Qie3qgF96V7Hu7UwqMARIL0SlJEz+nK3i2v1U4c5JujUVEGnXnEMMpxKN2cRkxRdl iAmFjPVsRUXJFDJveagEbnOtYrRjtYzx83mk5V5hqsQ8wp/OU45SKQvplGEoEPdXZEqn ZjIg== X-Forwarded-Encrypted: i=1; AFNElJ/33Q7FmNNRqkZwPwqseql9UDrPwNkANO4Sz+RtNBWoMLXPEeo0IkpC1mdguQySl/QJLC66PWkZy4HC01A=@vger.kernel.org X-Gm-Message-State: AOJu0YzVvng1AdkoIArVfdSM4jJl2DN2Jmm2v3YdTKHxMgOUv38AWwCO CCEs2DtgrSQflQG/zGdV5old3aOkJL/WXoLvnx+eL6WKTj8xGwWiznHN2SvjK1Eh74CI9DHDLGO IfqO5apK6 X-Received: from pfjd14.prod.google.com ([2002:a05:6a00:244e:b0:82c:70d1:f303]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6300:638c:b0:39f:27ab:2454 with SMTP id adf61e73a8af0-39fe400f914mr16515463637.49.1776208189989; Tue, 14 Apr 2026 16:09:49 -0700 (PDT) Date: Tue, 14 Apr 2026 23:09:42 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.54.0.rc0.605.g598a273b03-goog Message-ID: <20260414230943.41198-1-jrhilke@google.com> Subject: [PATCH v2 0/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" v2 of this series is only a single patch which adds a new script to print the segment:bus:device.function numbers of PCI devices on the user's system which have a VFIO selftest driver. Example: $ ./tools/testing/selftests/vfio/scripts/list_devices.sh 0000:6a:01.0 0000:6f:01.0 0000:74:01.0 The devices are compatible with all VFIO selftests. Other devices may be compatible with VFIO selftests that don't use the driver functionality, but no gaurantees. User's can automate binding devices to VFIO (which is required in order to run the selftests) by directing the output of list_devices.sh into tools/testing/selftests/vfio/scripts/setup.sh. Example: $ ./tools/testing/selftests/vfio/scripts/setup.sh $(./tools/testing/selftests/vfio/scripts/list_devices.sh) + echo "0000:6a:01.0" > /sys/bus/pci/drivers/vfio-pci/unbind + echo "" > /sys/bus/pci/devices/0000:6a:01.0/driver_override + echo "0000:6a:01.0" > /sys/bus/pci/drivers/idxd/bind + echo "0000:6f:01.0" > /sys/bus/pci/drivers/vfio-pci/unbind + echo "" > /sys/bus/pci/devices/0000:6f:01.0/driver_override + echo "0000:6f:01.0" > /sys/bus/pci/drivers/idxd/bind + echo "0000:74:01.0" > /sys/bus/pci/drivers/vfio-pci/unbind + echo "" > /sys/bus/pci/devices/0000:74:01.0/driver_override + echo "0000:74:01.0" > /sys/bus/pci/drivers/idxd/bind This series is based on top of the kvm/queue branch. Changes from v1: --- - Move the functionality to discover devices from setup.sh into its own script (Sean) - Omit the patch which automates binding devices to VFIO (Sean, David) - Change title of cover letter (Me) v1: https://lore.kernel.org/kvm/20260409015139.2800185-1-jrhilke@google.com/ Josh Hilke (1): vfio: selftests: Find devices that have VFIO selftest drivers 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 -- 2.54.0.rc0.605.g598a273b03-goog