On Tue, 2026-09-01 at 04:43 -0400, Michael S. Tsirkin wrote:
> On Tue, Sep 01, 2026 at 11:46:49AM +1000, [email protected] wrote:
> > From: Alistair Francis <[email protected]>
> > 
> > Legacy virtio devices only have 32 feature bits and therefore can't
> > set the VIRTIO_F_ACCESS_PLATFORM (bit 33) feature. This means the
> > vring_use_map_api() function will return false.
> > 
> > Currently Linux endpoint devices use the legacy virtio interface as
> > they aren't able to advertise the Common configuration capability.
> > As most PCI endpoint capable PCIe controllers do not allow
> > modifying the
> > capability list, and thus are unable to advertise the Common
> > configuration
> > capability. This means the device's inbound TLPs fault on the host
> > SMMU because the vring descriptors carry raw physical addresses.
> > 
> > This quirk forces a subset of legacy virtio devices to use the
> > DMA Map API (vring_use_map_api() will return true), which fixes
> > this
> > issue.
> > 
> > This doesn't affect existing devices as we are checking for an
> > otherwise invalid vendor ID.
> > 
> > Ideally we would update the endpoint devices (like scsi-pci-epf)
> > to not use the legacy virtio interface, but lots of endpoint
> > hardware (like the one in the RK3588) doesn't allow us to add
> > custom capabilities.
> > 
> > Signed-off-by: Alistair Francis <[email protected]>
> 
> I don't much like hacks around DMA API, it is very fragile already.
> 
> So, here's an idea:
> 
> put all the capabilities simply at a fixed offset in a memory BAR.

So just pick some hard coded address? Then update the host to check
that address if there is no Common configuration capability found in
the actual config space?

Seems doable

> 
> it's a small spec extension, but saves a lot of trouble IMHO.

How do we update the VirtIO spec to include that?

> 
> And in fact, people already complained that legacy pci config space
> should be avoided.

Yeah, I did get that impression. The name "legacy" does give that away
:)

> 
> What do you say?

Works for me. How would I update the spec to include that?

Alistair

Reply via email to