Skip to contentSkip to conversation

iommufd: Add two missing structures in ucmd_buffer

PATCH Superseded Yi Liu 2 participants 3 messages Jan 20, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yi Liu

author
#0 lore raw

PATCH 1/1 iommufd: Add two missing structures in ucmd_buffer

struct iommu_option and struct iommu_vfio_ioas are missed in ucmd_buffer. Although they are smaller than the size of ucmd_buffer, it is safer to list them in ucmd_buffer explicitly.

Fixes aad37e71d5c4 ("iommufd: IOCTLs for the io_pagetable")
Fixes d624d6652a65 ("iommufd: vfio container FD ioctl compatibility")
---
 drivers/iommu/iommufd/main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/iommufd/main.c +2 -0
index 083e6fcbe10a..1fbfda4b53bf 100644
@@ -255,6 +255,8 @@ union ucmd_buffer {
 	struct iommu_ioas_iova_ranges iova_ranges;
 	struct iommu_ioas_map map;
 	struct iommu_ioas_unmap unmap;
+	struct iommu_option option;
+	struct iommu_vfio_ioas vfio_ioas;
 #ifdef CONFIG_IOMMUFD_TEST
 	struct iommu_test_cmd test;
 #endif
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 20 lines

From: Liu, Yi L <[email protected]>
Sent: Friday, January 20, 2023 1:58 PM

struct iommu_option and struct iommu_vfio_ioas are missed in ucmd_buffer. Although they are smaller than the size of ucmd_buffer, it is safer to list them in ucmd_buffer explicitly.

Fixes aad37e71d5c4 ("iommufd: IOCTLs for the io_pagetable")
Fixes d624d6652a65 ("iommufd: vfio container FD ioctl compatibility")
---
 drivers/iommu/iommufd/main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/iommufd/main.c +0 -0
index 083e6fcbe10a..1fbfda4b53bf 100644

drivers/iommu/iommufd/main.c union ucmd_buffer { · line 262

Quoted 8 lines
drivers/iommu/iommufd/main.c +2 -0
@@ -255,6 +255,8 @@ union ucmd_buffer {
 	struct iommu_ioas_iova_ranges iova_ranges;
 	struct iommu_ioas_map map;
 	struct iommu_ioas_unmap unmap;
+	struct iommu_option option;
+	struct iommu_vfio_ioas vfio_ioas;
 #ifdef CONFIG_IOMMUFD_TEST
 	struct iommu_test_cmd test;
 #endif

while at it can you also add iommu_ioas_copy?

author
#2 lore raw
Quoted 18 lines

From: Tian, Kevin <[email protected]>
Sent: Friday, January 20, 2023 3:02 PM

Quoted 4 lines

From: Liu, Yi L <[email protected]>
Sent: Friday, January 20, 2023 1:58 PM

struct iommu_option and struct iommu_vfio_ioas are missed in

ucmd_buffer.

Quoted 10 lines

Although they are smaller than the size of ucmd_buffer, it is safer to list them in ucmd_buffer explicitly.

Fixes aad37e71d5c4 ("iommufd: IOCTLs for the io_pagetable")
Fixes d624d6652a65 ("iommufd: vfio container FD ioctl compatibility")
---
 drivers/iommu/iommufd/main.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 16 lines
Quoted 6 lines
drivers/iommu/iommufd/main.c +0 -0
index 083e6fcbe10a..1fbfda4b53bf 100644

drivers/iommu/iommufd/main.c union ucmd_buffer { · line 262

Quoted 8 lines
drivers/iommu/iommufd/main.c +2 -0
@@ -255,6 +255,8 @@ union ucmd_buffer {
 	struct iommu_ioas_iova_ranges iova_ranges;
 	struct iommu_ioas_map map;
 	struct iommu_ioas_unmap unmap;
+	struct iommu_option option;
+	struct iommu_vfio_ioas vfio_ioas;
 #ifdef CONFIG_IOMMUFD_TEST
 	struct iommu_test_cmd test;
 #endif

while at it can you also add iommu_ioas_copy?

Done in v2.

https://lore.kernel.org/kvm/[email protected]/T/#u

Regards,
Yi Liu