[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v1 05/22] vfio/common: Extract out vfio_kvm_device_[add/del]_
From: |
Duan, Zhenzhong |
Subject: |
RE: [PATCH v1 05/22] vfio/common: Extract out vfio_kvm_device_[add/del]_fd |
Date: |
Thu, 21 Sep 2023 10:22:38 +0000 |
>-----Original Message-----
>From: Cédric Le Goater <clg@redhat.com>
>Sent: Thursday, September 21, 2023 4:42 PM
>Subject: Re: [PATCH v1 05/22] vfio/common: Extract out
>vfio_kvm_device_[add/del]_fd
>
>On 9/20/23 13:49, Eric Auger wrote:
>> Hi Zhenzhong,
>>
>> On 8/30/23 12:37, Zhenzhong Duan wrote:
>>> ...which will be used by both legacy and iommufd backend.
>> I prefer genuine sentences in the commit msg. Also you explain what you
>> do but not why.
>>
>> suggestion: Introduce two new helpers, vfio_kvm_device_[add/del]_fd
>> which take as input a file descriptor which can be either a group fd or
>> a cdev fd. This uses the new KVM_DEV_VFIO_FILE VFIO KVM device group,
>> which aliases to the legacy KVM_DEV_VFIO_GROUP.
>
>Ah yes. I didn't understand why the 's/GROUP/FILE/' change in the
>VFIO KVM device ioctls. Thanks for clarifying.
>
>What about pre-6.6 kernels without KVM_DEV_VFIO_FILE support ?
They are purely alias. See below commit:
commit da3c22c74a3c6cbd26df40b2f6798a2d41be80ac
Author: Thomas Huth <thuth@redhat.com>
Date: Tue Sep 12 11:24:40 2023 +0200
linux-headers: Update to Linux v6.6-rc1
This update contains the required header changes for the
"target/s390x: AP-passthrough for PV guests" patch from
Steffen Eiden.
Message-ID: <20230912093432.180041-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index 1f3f3333a4..0d74ee999a 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -1414,9 +1414,16 @@ struct kvm_device_attr {
__u64 addr; /* userspace address of attr data */
};
-#define KVM_DEV_VFIO_GROUP 1
-#define KVM_DEV_VFIO_GROUP_ADD 1
-#define KVM_DEV_VFIO_GROUP_DEL 2
+#define KVM_DEV_VFIO_FILE 1
+
+#define KVM_DEV_VFIO_FILE_ADD 1
+#define KVM_DEV_VFIO_FILE_DEL 2
+
+/* KVM_DEV_VFIO_GROUP aliases are for compile time uapi compatibility */
+#define KVM_DEV_VFIO_GROUP KVM_DEV_VFIO_FILE
+
+#define KVM_DEV_VFIO_GROUP_ADD KVM_DEV_VFIO_FILE_ADD
+#define KVM_DEV_VFIO_GROUP_DEL KVM_DEV_VFIO_FILE_DEL
#define KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE 3
Pre-6.6 kernel not supporting KVM_DEV_VFIO_FILE also not support IOMMUFD.
So I think that's fine.
Thanks
Zhenzhong