From: Alex Williamson <alex.williamson@redhat.com>
To: "Rustad, Mark D" <mark.d.rustad@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"alexander.h.duyck@redhat.com" <alexander.h.duyck@redhat.com>,
"myron.stowe@redhat.com" <myron.stowe@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] vfio/pci: Use kernel VPD access functions
Date: Mon, 14 Sep 2015 10:54:13 -0600 [thread overview]
Message-ID: <1442249653.23936.17.camel@redhat.com> (raw)
In-Reply-To: <80CE59CA-1B93-42FF-96D1-6276B724203F@intel.com>
On Sat, 2015-09-12 at 01:11 +0000, Rustad, Mark D wrote:
> Alex,
>
> > On Sep 11, 2015, at 11:16 AM, Alex Williamson <alex.williamson@redhat.com> wrote:
> >
> > RFC - Is this something we should do?
>
> Superficially this looks pretty good. I need to think harder to be sure of the details.
>
> > Should we consider providing
> > similar emulation through PCI sysfs to allow lspci to also make use
> > of the vpd interfaces?
>
> It looks to me like lspci already uses the vpd attribute in sysfs to access VPD, so maybe nothing more than this is needed. No doubt lspci can be coerced into accessing VPD directly, but is that really worth going after? I'm not so sure.
>
> An strace of lspci accessing a device with VPD shows me:
>
> write(1, "\tCapabilities: [e0] Vital Produc"..., 39 Capabilities: [e0] Vital Product Data
> ) = 39
> open("/sys/bus/pci/devices/0000:02:00.0/vpd", O_RDONLY) = 4
> ----------------------------------------^^^ accesses to this should be safe, I think
>
> pread(4, "\202", 1, 0) = 1
> pread(4, "\10\0", 2, 1) = 2
> pread(4, "PVL Dell", 8, 3) = 8
> write(1, "\t\tProduct Name: PVL Dell\n", 25 Product Name: PVL Dell
> ) = 25
>
> and so forth.
Oh good, so aside from some rouge admin poking around with setpci access
through pci-sysfs is hopefully not an issue. Thanks for looking into
it.
Alex
next prev parent reply other threads:[~2015-09-14 16:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 18:16 [RFC PATCH] vfio/pci: Use kernel VPD access functions Alex Williamson
2015-09-12 1:11 ` Rustad, Mark D
2015-09-14 16:54 ` Alex Williamson [this message]
2015-09-14 21:34 ` Rustad, Mark D
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=1442249653.23936.17.camel@redhat.com \
--to=alex.williamson@redhat.com \
--cc=alexander.h.duyck@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mark.d.rustad@intel.com \
--cc=myron.stowe@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;
as well as URLs for NNTP newsgroup(s).