KVM: Delete all references to removed ioctls
Subsystems (4)
v2 cover KVM: Delete all references to removed ioctls
Hello,
This series contains patches that cleanups KVM headers and documentation, by removing left overs of ioctls that were already removed.
This is a v2 that instead of marking these ioctls as "obsoleted", remove any mentions to them. This was suggested by Sean Christopherson in v1.
Best regards,
Javier
Changes in v2:
- Delete all references to removed ioctls instead of marking them as deprecated (Sean Christopherson).
Javier Martinez Canillas (4):
KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl
KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl
KVM: Reference to kvm_userspace_memory_region in doc and comments
KVM: Add missing arch for KVM_CREATE_DEVICE and
KVM_{SET,GET}_DEVICE_ATTR
Documentation/virt/kvm/api.rst | 31 +++------------------------ arch/x86/include/uapi/asm/kvm.h | 8 ------- include/linux/kvm_host.h | 4 ++-- include/uapi/linux/kvm.h | 20 +++-------------- tools/arch/x86/include/uapi/asm/kvm.h | 8 ------- tools/include/uapi/linux/kvm.h | 20 +++-------------- 6 files changed, 11 insertions(+), 80 deletions(-)
Signature · 1 line
2.38.1
PATCH v2 1/4 KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl
The documentation says that the ioctl has been deprecated, but it has been actually removed and the remaining references are just left overs.
---
(no changes since v1)
Documentation/virt/kvm/api.rst | 16 ---------------- include/uapi/linux/kvm.h | 12 ------------ tools/include/uapi/linux/kvm.h | 12 ------------ 3 files changed, 40 deletions(-)
Documentation/virt/kvm/api.rst +0 -16
@@ -272,18 +272,6 @@ the VCPU file descriptor can be mmap-ed, including: KVM_CAP_DIRTY_LOG_RING, see section 8.3. -4.6 KVM_SET_MEMORY_REGION -------------------------- - -:Capability: basic -:Architectures: all -:Type: vm ioctl -:Parameters: struct kvm_memory_region (in) -:Returns: 0 on success, -1 on error - -This ioctl is obsolete and has been removed. - - 4.7 KVM_CREATE_VCPU -------------------
@@ -1377,10 +1365,6 @@ the memory region are automatically reflected into the guest. For example, an mmap() that affects the region will be made visible immediately. Another example is madvise(MADV_DROP). -It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl. -The KVM_SET_MEMORY_REGION does not allow fine grained control over memory -allocation and is deprecated. - 4.36 KVM_SET_TSS_ADDR ---------------------
include/uapi/linux/kvm.h +0 -12
@@ -86,14 +86,6 @@ struct kvm_debug_guest {/* *** End of deprecated interfaces *** */ -/* for KVM_CREATE_MEMORY_REGION */ -struct kvm_memory_region { -__u32 slot; -__u32 flags; -__u64 guest_phys_addr; -__u64 memory_size;/* bytes */ -}; -/* for KVM_SET_USER_MEMORY_REGION */ struct kvm_userspace_memory_region {__u32 slot;
@@ -1437,10 +1429,6 @@ struct kvm_vfio_spapr_tce {__s32 tablefd; }; -/* -* ioctls for VM fds -*/ -#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)/* * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns * a vcpu fd.
tools/include/uapi/linux/kvm.h +0 -12
@@ -86,14 +86,6 @@ struct kvm_debug_guest {/* *** End of deprecated interfaces *** */ -/* for KVM_CREATE_MEMORY_REGION */ -struct kvm_memory_region { -__u32 slot; -__u32 flags; -__u64 guest_phys_addr; -__u64 memory_size;/* bytes */ -}; -/* for KVM_SET_USER_MEMORY_REGION */ struct kvm_userspace_memory_region {__u32 slot;
@@ -1437,10 +1429,6 @@ struct kvm_vfio_spapr_tce {__s32 tablefd; }; -/* -* ioctls for VM fds -*/ -#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)/* * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns * a vcpu fd.
Signature · 1 line
2.38.1
PATCH v2 2/4 KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl
In reply to Javier Martinez CanillasThe documentation says that the ioctl has been deprecated, but it has been actually removed and the remaining references are just left overs.
---
(no changes since v1)
Documentation/virt/kvm/api.rst | 11 ----------- arch/x86/include/uapi/asm/kvm.h | 8 -------- include/uapi/linux/kvm.h | 2 -- tools/arch/x86/include/uapi/asm/kvm.h | 8 -------- tools/include/uapi/linux/kvm.h | 2 -- 5 files changed, 31 deletions(-)
Documentation/virt/kvm/api.rst +0 -11
@@ -356,17 +356,6 @@ see the description of the capability. Note that the Xen shared info page, if configured, shall always be assumed to be dirty. KVM will not explicitly mark it such. -4.9 KVM_SET_MEMORY_ALIAS ------------------------- - -:Capability: basic -:Architectures: x86 -:Type: vm ioctl -:Parameters: struct kvm_memory_alias (in) -:Returns: 0 (success), -1 (error) - -This ioctl is obsolete and has been removed. - 4.10 KVM_RUN ------------
arch/x86/include/uapi/asm/kvm.h +0 -8
@@ -53,14 +53,6 @@/* Architectural interrupt line count. */ #define KVM_NR_INTERRUPTS 256 -struct kvm_memory_alias { -__u32 slot;/* this has a different namespace than memory slots */ -__u32 flags; -__u64 guest_phys_addr; -__u64 memory_size; -__u64 target_phys_addr; -}; -/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */ struct kvm_pic_state {__u8 last_irr;/* edge detection */
include/uapi/linux/kvm.h +0 -2
@@ -1435,8 +1435,6 @@ struct kvm_vfio_spapr_tce {*/ #define KVM_CREATE_VCPU _IO(KVMIO, 0x41)#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) -/* KVM_SET_MEMORY_ALIAS is obsolete: */ -#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
tools/arch/x86/include/uapi/asm/kvm.h +0 -8
@@ -53,14 +53,6 @@/* Architectural interrupt line count. */ #define KVM_NR_INTERRUPTS 256 -struct kvm_memory_alias { -__u32 slot;/* this has a different namespace than memory slots */ -__u32 flags; -__u64 guest_phys_addr; -__u64 memory_size; -__u64 target_phys_addr; -}; -/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */ struct kvm_pic_state {__u8 last_irr;/* edge detection */
tools/include/uapi/linux/kvm.h +0 -2
@@ -1435,8 +1435,6 @@ struct kvm_vfio_spapr_tce {*/ #define KVM_CREATE_VCPU _IO(KVMIO, 0x41)#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) -/* KVM_SET_MEMORY_ALIAS is obsolete: */ -#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
Signature · 1 line
2.38.1
PATCH v2 3/4 KVM: Reference to kvm_userspace_memory_region in doc and comments
In reply to Javier Martinez CanillasThere are still references to the removed kvm_memory_region data structure but the doc and comments should mention struct kvm_userspace_memory_region instead, since that is what's used by the ioctl that replaced the old one and this data structure support the same set of flags.
---
(no changes since v1)
Documentation/virt/kvm/api.rst | 2 +- include/linux/kvm_host.h | 4 ++-- include/uapi/linux/kvm.h | 6 +++--- tools/include/uapi/linux/kvm.h | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-)
Documentation/virt/kvm/api.rst +1 -1
@@ -1309,7 +1309,7 @@ yet and must be cleared on entry. __u64 userspace_addr; /* start of the userspace allocated memory */ }; - /* for kvm_memory_region::flags */ + /* for kvm_userspace_memory_region::flags */ #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) #define KVM_MEM_READONLY (1UL << 1)
include/linux/kvm_host.h +2 -2
@@ -50,8 +50,8 @@#endif /* -* The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used -* in kvm, other bits are visible for userspace which are defined in +* The bit 16 ~ bit 31 of kvm_userspace_memory_region::flags are internally +* used in kvm, other bits are visible for userspace which are defined in * include/linux/kvm_h. */ #define KVM_MEMSLOT_INVALID (1UL << 16)
include/uapi/linux/kvm.h +3 -3
@@ -96,9 +96,9 @@ struct kvm_userspace_memory_region { };/* -* The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace, -* other bits are reserved for kvm internal use which are defined in -* include/linux/kvm_host.h. +* The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for +* userspace, other bits are reserved for kvm internal use which are defined +* in include/linux/kvm_host.h. */ #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)#define KVM_MEM_READONLY (1UL << 1)
tools/include/uapi/linux/kvm.h +3 -3
@@ -96,9 +96,9 @@ struct kvm_userspace_memory_region { };/* -* The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace, -* other bits are reserved for kvm internal use which are defined in -* include/linux/kvm_host.h. +* The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for +* userspace, other bits are reserved for kvm internal use which are defined +*in include/linux/kvm_host.h. */ #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)#define KVM_MEM_READONLY (1UL << 1)
Signature · 1 line
2.38.1
PATCH v2 4/4 KVM: Add missing arch for KVM_CREATE_DEVICE and KVM_{SET,GET}_DEVICE_ATTR
In reply to Javier Martinez CanillasThe ioctls are missing an architecture property that is present in others.
---
(no changes since v1)
Documentation/virt/kvm/api.rst | 2 ++ 1 file changed, 2 insertions(+)
Documentation/virt/kvm/api.rst +2 -0
@@ -3266,6 +3266,7 @@ valid entries found. ---------------------- :Capability: KVM_CAP_DEVICE_CTRL +:Architectures: all :Type: vm ioctl :Parameters: struct kvm_create_device (in/out) :Returns: 0 on success, -1 on error
@@ -3306,6 +3307,7 @@ number. :Capability: KVM_CAP_DEVICE_CTRL, KVM_CAP_VM_ATTRIBUTES for vm device, KVM_CAP_VCPU_ATTRIBUTES for vcpu device KVM_CAP_SYS_ATTRIBUTES for system (/dev/kvm) device (no set) +:Architectures: x86, arm64, s390 :Type: device ioctl, vm ioctl, vcpu ioctl :Parameters: struct kvm_device_attr :Returns: 0 on success, -1 on error
Signature · 1 line
2.38.1
Queued, thanks.
Paolo