[PATCH 0/3] IOMMU user API enhancement

From: Jacob Pan
Date: Wed Jan 29 2020 - 00:57:10 EST


IOMMU user API header was introduced to support nested DMA translation and
related fault handling. The current UAPI data structures consist of three
areas that cover the interactions between host kernel and guest:
- fault handling
- cache invalidation
- bind guest page tables, i.e. guest PASID

With future extension in mind, the UAPI structures passed from user to kernel
always starts with a mandatory version field (u32). While this is flexible
for extensions of individual structures, it is difficult to maintain support
of combinations of different version numbers.

This patchset introduces a unified UAPI version number that governs all the
UAPI data structure versions. When userspace query UAPI version for check on
compatibility, a single match would be sufficient.

After UAPI version check, users such as VFIO can also retrieve the matching
data structure size based on version and type. Kernel IOMMU UAPI support is
always backward compatible. Data structures are also only open to extension
and closed to modifications.

The introduction of UAPI version does not change the existing UAPI but rather
simplify the data structure version and size matching.

Thanks,

Jacob

Jacob Pan (3):
iommu/uapi: Define uapi version and capabilities
iommu/uapi: Use unified UAPI version
iommu/uapi: Add helper function for size lookup

drivers/iommu/intel-iommu.c | 3 ++-
drivers/iommu/intel-svm.c | 2 +-
drivers/iommu/iommu.c | 25 +++++++++++++++++++-
include/linux/iommu.h | 6 +++++
include/uapi/linux/iommu.h | 57 ++++++++++++++++++++++++++++++++++++++++-----
5 files changed, 84 insertions(+), 9 deletions(-)

--
2.7.4