From: Shunsuke Mie <mie@igel.co.jp>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>,
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: Tue, 18 Jun 2024 21:51:41 +0900 [thread overview]
Message-ID: <CANXvt5pbdsSMc9C-nV0MiOAJPVyxXKu5otwLp2yopqBdNLS26A@mail.gmail.com> (raw)
In-Reply-To: <20240618064231-mutt-send-email-mst@kernel.org>
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.
...
```
>
> > > --
> > > MST
> > >
>
next prev parent reply other threads:[~2024-06-18 12:51 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 [this message]
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
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=CANXvt5pbdsSMc9C-nV0MiOAJPVyxXKu5otwLp2yopqBdNLS26A@mail.gmail.com \
--to=mie@igel.co.jp \
--cc=jasowang@redhat.com \
--cc=linux-pci@vger.kernel.org \
--cc=mani@kernel.org \
--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).