to a Context Table. This virt_id helps IOMMU drivers to link the vID to a pID of the device against the physical IOMMU instance. This is essential for a vIOMMU-based invalidation, where the request contains a device's vID for a device cache flush, e.g. ATC invalidation.
probably connect this to vCMDQ passthrough? otherwise for sw-based invalidation the userspace can always replace vID with pID before submitting the request.
You can't just do that, the ID in the invalidation command has to be validated by the kernel.
At that point you may as well just use the vID instead of inventing a new means to validate raw pIDs.
VT-D avoided this so far because it is pushing the invalidation through the device object and the device object provides the ID directly. No IDs in commands, no switching devices during a command batch.
Jason