From: Alex Mastro <amastro@fb.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Alex Mastro <amastro@fb.com>,
Alex Williamson <alex.williamson@redhat.com>, <peterx@redhat.com>,
<kbusch@kernel.org>, <kvm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vfio/pci: print vfio-device name to fdinfo
Date: Tue, 24 Jun 2025 09:35:58 -0700 [thread overview]
Message-ID: <20250624163559.2984626-1-amastro@fb.com> (raw)
In-Reply-To: <20250624005605.GA72557@ziepe.ca>
On Mon, 23 Jun 2025 21:56:05 -0300 Jason Gunthorpe <jgg@ziepe.ca> wrote:
> For the legacy route this effectively gives you the iommu group.
This is true, but
- There could be multiple devices per group, and I can't see a good way to
determine exactly which one is in use. (we happen to have one device per
group, so this particular concern is somewhat moot for us)
- In our use case, we vend the vfio device fd via SCM_RIGHTS to other processes
which did not open the group fd. We keep track of this internally, but it's an
imperfect solution, and we'd like a more fundamental way to query the kernel
for this.
> For the new route this will give you the struct device.
>
> The userspace can deduce more information, like the actual PCI BDF, by
> mapping the name through sysfs.
In the vfio cdev case, <pci sysfs path>/vfio-dev/X tells you the
/dev/vfio/devices/X mapping, but is there a straightforward way to map in the
opposite direction?
I'm open to other approaches to solving the issue, but making an additive change
to fdinfo seemed innocuous enough, and hopefully unlikely to be incompatible
with future direction of this subsystem.
Thanks,
Alex
next prev parent reply other threads:[~2025-06-24 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 21:02 Alex Mastro
2025-06-23 21:50 ` Keith Busch
2025-06-23 22:18 ` Alex Williamson
2025-06-23 23:14 ` Alex Mastro
2025-06-24 0:56 ` Jason Gunthorpe
2025-06-24 16:23 ` Alex Williamson
2025-06-24 18:12 ` Jason Gunthorpe
2025-06-24 16:35 ` Alex Mastro [this message]
2025-06-24 18:16 ` Jason Gunthorpe
2025-06-24 18:53 ` Alex Mastro
2025-06-24 18:58 ` Jason Gunthorpe
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=20250624163559.2984626-1-amastro@fb.com \
--to=amastro@fb.com \
--cc=alex.williamson@redhat.com \
--cc=jgg@ziepe.ca \
--cc=kbusch@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterx@redhat.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
all inboxes | Powered by JetHome®