From: Manivannan Sadhasivam <mani@kernel.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>,
Shunsuke Mie <mie@igel.co.jp>,
linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
jasowang@redhat.com, xuanzhuo@linux.alibaba.com
Subject: Re: [RFC] Legacy Virtio Driver with Device Has Limited Memory Access
Date: Wed, 19 Jun 2024 13:58:13 +0530 [thread overview]
Message-ID: <20240619082813.GA3898@thinkpad> (raw)
In-Reply-To: <20240619035655-mutt-send-email-mst@kernel.org>
On Wed, Jun 19, 2024 at 03:58:15AM -0400, Michael S. Tsirkin wrote:
> On Wed, Jun 19, 2024 at 01:09:29PM +0530, Manivannan Sadhasivam wrote:
> > On Wed, Jun 19, 2024 at 03:32:41AM -0400, Michael S. Tsirkin wrote:
> > > On Tue, Jun 18, 2024 at 09:51:41PM +0900, Shunsuke Mie wrote:
> > > > 2024年6月18日(火) 19:47 Michael S. Tsirkin <mst@redhat.com>:
> > > > >
> > > > > On Tue, Jun 18, 2024 at 07:40:34PM +0900, Shunsuke Mie wrote:
> > > > > > 2024年6月18日(火) 19:33 Michael S. Tsirkin <mst@redhat.com>:
> > > > > > >
> > > > > > > On Tue, Jun 18, 2024 at 07:15:47PM +0900, Shunsuke Mie wrote:
> > > > > > > > Thank you for your response.
> > > > > > > >
> > > > > > > > 2024年6月18日(火) 18:47 Michael S. Tsirkin <mst@redhat.com>:
> > > > > > > > >
> > > > > > > > > On Tue, Jun 18, 2024 at 08:41:09AM +0900, Shunsuke Mie wrote:
> > > > > > > > > > Let's clarify the situation.
> > > > > > > > > >
> > > > > > > > > > The Virtio device and driver are not working properly due to a
> > > > > > > > > > combination of the following reasons:
> > > > > > > > > >
> > > > > > > > > > 1. Regarding VIRTIO_F_ACCESS_PLATFORM:
> > > > > > > > > > - The modern spec includes VIRTIO_F_ACCESS_PLATFORM, which allows
> > > > > > > > > > Physical DMAC to be used.
> > > > > > > > > > - This feature is not available in the legacy spec.
> > > > > > > > >
> > > > > > > > > ... because legacy drivers don't set it
> > > > > > > > >
> > > > > > > > > > 2. Regarding Virtio PCIe Capability:
> > > > > > > > > > - The modern spec requires Virtio PCIe Capability.
> > > > > > > > >
> > > > > > > > > It's a PCI capability actually. People have been asking
> > > > > > > > > about option to make it a pcie extended capability,
> > > > > > > > > but no one did the spec, qemu and driver work, yet.
> > > > > > > > >
> > > > > > > > > > - In some environments, Virtio PCIe Capability cannot be provided.
> > > > > > > > >
> > > > > > > > > why not?
> > > > > > > > PCIe Endpoint Controller chips are available from several vendors and allow
> > > > > > > > software to describe the behavior of PCIe Endpoint functions. However, they
> > > > > > > > offer only limited functionality. Specifically, while PCIe bus communication is
> > > > > > > > programmable, PCIe Capabilities are fixed and cannot be made to show as
> > > > > > > > virtio's.
> > > > > > >
> > > > > > > Okay. So where could these structures live, if not in pci config?
> > > > > > What does "these structures" refer to? PCIe Capabilities? virtio configs?
> > > > >
> > > > > Virtio uses a bunch of read only structures that look like this:
> > > > >
> > > > > struct virtio_pci_cap {
> > > > >
> > > > > ..... [skipped, specific to pci config caps] ...
> > > > >
> > > > > u8 cfg_type; /* Identifies the structure. */
> > > > > u8 bar; /* Where to find it. */
> > > > > u8 id; /* Multiple capabilities of the same type */
> > > > > u8 padding[2]; /* Pad to full dword. */
> > > > > le32 offset; /* Offset within bar. */
> > > > > le32 length; /* Length of the structure, in bytes. */
> > > > > };
> > > > >
> > > > >
> > > > > The driver uses that to locate parts of device interface it
> > > > > later uses.
> > > > >
> > > > >
> > > > > Per spec, they are currently in pci config, you are saying some devices
> > > > > can't have this data in pci config - is that right? Where yes?
> > > > I understood. The configuration structure is in the space that is
> > > > indicated by BAR0.
> > > > Follows the instructions in the spec:
> > > > ```
> > > > 4.1.4.10 Legacy Interfaces: A Note on PCI Device Layout
> > > > Transitional devices MUST present part of configuration registers in a
> > > > legacy configuration structure in BAR0 in the first I/O region of the
> > > > PCI device, as documented below.
> > > > ...
> > > > ```
> > >
> > > No, and it's best everyone stopped talking about legacy like we
> > > are going to add new features to it.
> > >
> > > The configuration structure is in the space that is
> > > indicated by the vendor specific structure, which is currently
> > > in pci config space.
> > >
> > > If use of a vendor specific structure in pci config space is
> > > problematic, we can try to fix that by extending the virtio spec.
> > >
> >
> > It is indeed problematic as the device vendors usually use those capability
> > registers themselves and wouldn't allow users to configure them.
> >
> > So if the spec is ammended to support other way of finding the virtio config
> > structures, then it would really unblock us from supporting modern virtio
> > devices.
> >
> > - Mani
>
> Okay.
> Anyone from your side can join the virtio TC to champion this?
> We don't have anyone knowledgeable about this protocol ATM AFAIK.
>
Sure. Myself/Shunsuke can join and help with this.
Shunsuke did the Virtio bringup for PCI Endpoint subsystem and I'm the
maintainer for it.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-06-19 8:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 4:38 [RFC] Legacy Virtio Driver with Device Has Limited Memory Access Shunsuke Mie
2024-05-16 12:59 ` Manivannan Sadhasivam
2024-05-16 13:13 ` Michael S. Tsirkin
2024-05-20 10:24 ` Shunsuke Mie
2024-05-30 15:07 ` Manivannan Sadhasivam
2024-05-20 13:22 ` Michael S. Tsirkin
2024-06-14 9:50 ` Manivannan Sadhasivam
2024-06-17 23:41 ` Shunsuke Mie
2024-06-18 6:54 ` Manivannan Sadhasivam
2024-06-18 9:47 ` Michael S. Tsirkin
2024-06-18 10:15 ` Shunsuke Mie
2024-06-18 10:33 ` Michael S. Tsirkin
2024-06-18 10:40 ` Shunsuke Mie
2024-06-18 10:47 ` Michael S. Tsirkin
2024-06-18 12:51 ` Shunsuke Mie
2024-06-19 7:32 ` Michael S. Tsirkin
2024-06-19 7:39 ` Manivannan Sadhasivam
2024-06-19 7:58 ` Michael S. Tsirkin
2024-06-19 8:28 ` Manivannan Sadhasivam [this message]
2024-06-19 7:07 ` Christoph Hellwig
2024-06-18 10:09 ` Michael S. Tsirkin
2024-05-30 16:43 ` Michael S. Tsirkin
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=20240619082813.GA3898@thinkpad \
--to=mani@kernel.org \
--cc=jasowang@redhat.com \
--cc=linux-pci@vger.kernel.org \
--cc=mie@igel.co.jp \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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).