RE: [RFC] /dev/ioasid uAPI proposal

From: Tian, Kevin
Date: Wed Jun 23 2021 - 04:20:06 EST


> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Saturday, June 19, 2021 2:31 AM
>
> On Fri, Jun 18, 2021 at 07:03:31PM +0200, Jean-Philippe Brucker wrote:
>
> > configuration. The Arm SMMUs have a lot of small features that
> > implementations can mix and match and that a user shouldn't have to care
> > about, and there are lots of different implementations by various
> > vendors.
>
> This is really something to think about carefully in this RFC - I do
> have a guess that a 'HW specific' channel is going to be useful here.

Agree.

>
> If the goal is for qemu to provide all these fiddly things and they
> cannot be SW emulated, then direct access to the fiddly HW native
> stuff is possibly necessary.
>
> We've kind of seen this mistake in DRM and RDMA
> historically. Attempting to generalize too early, or generalize
> something that is really a one off. Better for everyone to just keep
> it as a one off.
>

Yes. Except some generic info (e.g. addr_width), most format info can
be exposed via a vendor specific data union region. There is no need
to define those vendor bits explicitly in the uAPI. Kernel IOMMU driver
and vIOMMU emulation logic know how to interpret them.

Take VT-d for example, all format/cap info are carried in two registers
(cap_reg and ecap_reg) thus two u64 fields are sufficient...

Thanks
Kevin