Re: [PATCH v1 02/14] iommufd: Add nesting related data structures for ARM SMMUv3

From: Robin Murphy
Date: Fri Mar 10 2023 - 10:00:23 EST


On 2023-03-09 21:01, Jason Gunthorpe wrote:
For a lot of SMMUv3 implementations that have a single queue and for
other architectures, we can do better than hardware emulation.

How is using a SW emulated virtio formatted queue better than using a
SW emulated SMMUv3 ECMDQ?

Since it's not been said, the really big thing is that virtio explicitly informs the host whenever the guest maps something. Emulating SMMUv3 means the host has to chase all the pagetable pointers in guest memory and trap writes such that it has visibility of invalid->valid transitions and can update the physical shadow pagetable correspondingly.

FWIW we spent quite some time on and off discussing something like VT-d's "caching mode", but never found a convincing argument that it was a gap which needed filling, since we already had hardware nesting for maximum performance and a paravirtualisation option for efficient emulation. Thus full SMMUv3 emulation seems to just sit at the bottom as the maximum-compatibility option for pushing an unmodified legacy bare-metal software stack into a VM where nesting isn't available.

Cheers,
Robin.