summaryrefslogtreecommitdiff
path: root/include/uapi/linux/iommu.h
diff options
context:
space:
mode:
authorJacob Pan <jacob.pan.linux@gmail.com>2020-09-25 09:32:44 -0700
committerJoerg Roedel <jroedel@suse.de>2020-10-01 14:52:46 +0200
commit8d3bb3b8cbf2ffb3ef73720a48b3445518dcdb55 (patch)
tree0128ef643c3e803b601e0665b73b2a818b717c53 /include/uapi/linux/iommu.h
parent1e6aaae93e9ddb9dc664993eb949b1da94cab3a5 (diff)
iommu/uapi: Use named union for user data
IOMMU UAPI data size is filled by the user space which must be validated by the kernel. To ensure backward compatibility, user data can only be extended by either re-purpose padding bytes or extend the variable sized union at the end. No size change is allowed before the union. Therefore, the minimum size is the offset of the union. To use offsetof() on the union, we must make it named. Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Link: https://lore.kernel.org/linux-iommu/20200611145518.0c2817d6@x1.home/ Link: https://lore.kernel.org/r/1601051567-54787-4-git-send-email-jacob.jun.pan@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/uapi/linux/iommu.h')
-rw-r--r--include/uapi/linux/iommu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/uapi/linux/iommu.h b/include/uapi/linux/iommu.h
index b42acc8fe007..5946779ac1f9 100644
--- a/include/uapi/linux/iommu.h
+++ b/include/uapi/linux/iommu.h
@@ -267,7 +267,7 @@ struct iommu_cache_invalidate_info {
union {
struct iommu_inv_pasid_info pasid_info;
struct iommu_inv_addr_info addr_info;
- };
+ } granu;
};
/**
@@ -333,7 +333,7 @@ struct iommu_gpasid_bind_data {
/* Vendor specific data */
union {
struct iommu_gpasid_bind_data_vtd vtd;
- };
+ } vendor;
};
#endif /* _UAPI_IOMMU_H */