Re: [PATCH] iommu: Add Kconfig help text for IOMMU_SVA

From: Linus Torvalds
Date: Mon May 08 2023 - 13:18:20 EST


On Mon, May 8, 2023 at 9:55 AM Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
>
> CONFIG_IOMMU_MM_PASID perhaps? Says what it does without a clue about
> why it does it. x86 arch code could select it ideally?

Maybe we don't even need the "IOMMU" part. It's a core x86
architecture feature. Maybe it usually (always?) gets used within the
framework of some IOMMU work, but I guess ENCQCMD could be used in
some hardwired way even without that (ie is it possible to have just
some "basic PASID set up by VMM environment" thing?)

I don't actually know who uses it and how, so I'm probably not the
right person to name it, but just looking at the x86 code that sets
it, the PASID code technically has no connection to any iommu code,
it's literally a core CPU feature with an MSR and some magic faulting
thing, and seems to be possibly usable as-is.

That existing

#ifdef CONFIG_IOMMU_SVA

in the x86 traps.c code just looks odd, and making it be
CONFIG_IOMMU_MM_PASID sounds better to me. I'm just not sure about the
"IOMMU" part either. Just "MM_PASID"?

That said, the arm-smmu-v3-sva.c code clearly *also* uses pasid,
except it seems to really want to call it "ssid".

So "having a per-mm ASID for IO" is clearly a common feature. But
naming seems hard, with x86 calling it PASID, arm64 seemingly calling
it "SSID".

Right now the only user *does* seem to be through the IOMMU SVA code,
but that may or may not be fundamental.

Now, "SSID" is a completely horrible name, as I immediately realized
when I tried to google for it. So arm64 is just wrong, and we're most
definitely continuing to call it PASID.

I'd lean towards just "CONFIG_MM_PASID" or something, but at some
point this is bikeshedding, and I don't know about any possible
non-iommu direct uses?

Linus