From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.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 A93133921F6 for ; Fri, 8 May 2026 22:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778278827; cv=none; b=TUwXkgjiMzxYBN/zscU3bhaTJYOTf2I/ABi10ZZDH4RqDgiKtUMV7MWdCrw40CJfTlgW4Z5X95mZ/hsTjcuo6rAQ+vchnzb8vztooL/6fWyPJ0aPdcwlue5jxkM8OtJur6sLiQGH6rHbc7rE3l75y2vqp2s0iWE4OmObdnxXHpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778278827; c=relaxed/simple; bh=4uFFv5MvAur3RLvJlpUt1T+THlEFP25FUijFCqNt23Y=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=joz1lHHqMeAXMR4eOnMmbGXaJAofx7t2F5shyyuH6lONr2D3c4fD1Bgpfj9Zu46oz9aWSbf1ArwvDfJZgwuNlcy+xceLnRJVCSzHrIk2unCqPc9Y81t7ZoRQ2x1yy09qiM1Df0VbDgMxF0rMlKEWCdURyGMFsysxZ283UxSFT+w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FWxg7kF2; arc=none smtp.client-ip=209.85.214.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--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FWxg7kF2" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2b7aba0af02so27979875ad.2 for ; Fri, 08 May 2026 15:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1778278826; x=1778883626; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=dbnJr8V3f4FccvTLLN48pS9vxFL7/axfr6qZXL890Pc=; b=FWxg7kF27NCp22cwRCYadQta4DPEfsWleJPwrEinQj/15dy2b3YETCsbOdWzjR/XJt GSXPwygqAMqfSpGUzkA4Zp8CgBG4aYcrLoZoO+HU8rHV11v/COSedMidDsQHPH6SBQgO BHVIHMGmCUIfBYa0lQQuItw4J7+nsWiuPg6PXOJ2e8eZu9s3rtj2m/VgJ1uU057scLd+ Ah/U0bSys7X2yVqUjP2eV9cH8K6uQ1e7E88xTXW57G8hdyQPj+q3fkd6p3t7Ez1h+8tU DYQ7QV9PWU3T75WuozdJj2/6XZ/6hfqD7rDW0IucKGEvZU+Z+tAwl6V0CiJM0gsPbI/9 nVBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778278826; x=1778883626; h=content-transfer-encoding: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=dbnJr8V3f4FccvTLLN48pS9vxFL7/axfr6qZXL890Pc=; b=ZYjx140+nKmAmejvIf73cIEas1wjHRYIsgUyKtjxd/aWmfu3U8jpQojijgDODKjHNn Nj8d3IQidhc7NpYC4K+Sn2TJze92h2/0RSSNyd9HuOWVimVHBbslNl79BBcfEpTCKxan NFpPWV0OUwwGI5VNruWTnPy/NqhfVw3YlexTxfZwtSApRZVIcZpBAD6noW76PFpFhQKu EcofnUX4sAGguHtwhXqWqOs9FFjUAJhHbC80HiPCaE2emAh36LZ/sC1tTgEOVf8RamPv SP6wSdhYO7PQze0axH8GV4tftF/r+eVVImdtJv4nQuScUBNaO8fASt1L2IYk7j95FQji EIRg== X-Forwarded-Encrypted: i=1; AFNElJ/d3v/VByq+zbShT+qPig7jxzfrI7dsRRlS2QS76WzIMdEiodrpdz88ufKqSMJqE4hwmCZmKGgLB1cXmGQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxSSoR0bW7x+NFzU/vWwnzhP/LoXRdp/nkgv19ojkIHCm5A0csw fl/A6fBgbwrBvoFEruPgCe6cnVTj7w5V0Jq+AsF8526XxvIPwxdb8Qywyfs+y5K0Ml4HfAlQ3XR 107KiSg== X-Received: from plbd11.prod.google.com ([2002:a17:902:f14b:b0:2b0:b1aa:e23f]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3847:b0:2ba:77a6:1d4c with SMTP id d9443c01a7336-2ba798c2a93mr143912645ad.26.1778278825873; Fri, 08 May 2026 15:20:25 -0700 (PDT) Date: Fri, 8 May 2026 15:20:25 -0700 In-Reply-To: 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> <20260414230943.41198-2-jrhilke@google.com> Message-ID: Subject: Re: [PATCH v2 1/1] vfio: selftests: Find devices that have VFIO selftest drivers From: Sean Christopherson To: Josh Hilke Cc: Alex Williamson , David Matlack , Vipin Sharma , Raghavendra Rao Ananta , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, May 08, 2026, Josh Hilke wrote: > On Fri, May 8, 2026 at 11:17=E2=80=AFAM Sean Christopherson wrote: > > > > On Tue, Apr 14, 2026, Josh Hilke wrote: > > > +# 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}' > > > > For ignorant people like me, it would be helpful to capture what device= was actually > > found. I mean, I don't necessarily know exactly what these devices do,= but as the > > list grows, at least having a general sense of what device I'm going to= be feeding > > into VFIO would be helpful. > > >=20 > Sure I can do that. >=20 > > # ./devices.sh > > Intel SPR DSA (8086:0b25) Device IDs: > > 0000:6a:01.0 > > 0000:6f:01.0 > > 0000:74:01.0 > > 0000:79:01.0 > > 0000:e7:01.0 > > 0000:ec:01.0 > > 0000:f1:01.0 > > 0000:f6:01.0 >=20 > How about a "-v" (verbose) option which prints the device name > alongside the BDF? > Works for me. =20 > $ ./list_devices.sh -v > 0000:6a:01.0 Intel SPR DSA (8086:0b25) > 0000:6f:01.0 Intel SPR DSA (8086:0b25) Maybe add a dash to visually separate things? E.g. 0000:6a:01.0 - Intel SPR DSA (8086:0b25) =20 > This approach preserves the ability to pipe the script output into > /tools/testing/selftests/vfio/scripts/setup.sh to automate binding the > devices to VFIO by excluding the -v arg since the setup script expects > a list of BDFs. Alternatively, -q for quiet? Or: ./devices.sh | cut -f 1 -d ' ' | setup.sh Or have setup.h do the cutting? I'm a-ok with a -v, but if the script is m= ostly going to be run by humans (no idea if this is true), it seems like it shoul= d use the more verbose version by default.