* [PATCH v2 0/4] KVM: Delete all references to removed ioctls
@ 2022-12-02 10:50 Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 1/4] KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl Javier Martinez Canillas
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-12-02 10:50 UTC (permalink / raw)
To: linux-kernel
Cc: Paolo Bonzini, Sergio Lopez Pascual, Sean Christopherson,
Javier Martinez Canillas, Arnaldo Carvalho de Melo,
Borislav Petkov, Dan Williams, Dave Hansen, Fabiano Rosas,
Guang Zeng, Gustavo A. R. Silva, H. Peter Anvin, Ingo Molnar,
Jing Liu, Jonathan Corbet, Nicholas Piggin, Thomas Gleixner,
Wei Wang, Yang Zhong, kvm, linux-doc, x86
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(-)
--
2.38.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/4] KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl
2022-12-02 10:50 [PATCH v2 0/4] KVM: Delete all references to removed ioctls Javier Martinez Canillas
@ 2022-12-02 10:50 ` Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 2/4] KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl Javier Martinez Canillas
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-12-02 10:50 UTC (permalink / raw)
To: linux-kernel
Cc: Paolo Bonzini, Sergio Lopez Pascual, Sean Christopherson,
Javier Martinez Canillas, Arnaldo Carvalho de Melo, Fabiano Rosas,
Guang Zeng, Gustavo A. R. Silva, Jonathan Corbet, Nicholas Piggin,
Wei Wang, kvm, linux-doc
The documentation says that the ioctl has been deprecated, but it has been
actually removed and the remaining references are just left overs.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
(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(-)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index eee9f857a986..54af33645df3 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -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
---------------------
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 0d5d4419139a..8899201d5964 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -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.
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 0d5d4419139a..8899201d5964 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -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.
--
2.38.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/4] KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl
2022-12-02 10:50 [PATCH v2 0/4] KVM: Delete all references to removed ioctls Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 1/4] KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl Javier Martinez Canillas
@ 2022-12-02 10:50 ` Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 3/4] KVM: Reference to kvm_userspace_memory_region in doc and comments Javier Martinez Canillas
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-12-02 10:50 UTC (permalink / raw)
To: linux-kernel
Cc: Paolo Bonzini, Sergio Lopez Pascual, Sean Christopherson,
Javier Martinez Canillas, Arnaldo Carvalho de Melo,
Borislav Petkov, Dan Williams, Dave Hansen, Gustavo A. R. Silva,
H. Peter Anvin, Ingo Molnar, Jing Liu, Jonathan Corbet,
Nicholas Piggin, Thomas Gleixner, Wei Wang, Yang Zhong, kvm,
linux-doc, x86
The documentation says that the ioctl has been deprecated, but it has been
actually removed and the remaining references are just left overs.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
(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(-)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index 54af33645df3..85a5b12eb017 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -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
------------
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 46de10a809ec..649e50a8f9dd 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -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 */
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 8899201d5964..6ba2928f8f18 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -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, \
diff --git a/tools/arch/x86/include/uapi/asm/kvm.h b/tools/arch/x86/include/uapi/asm/kvm.h
index 46de10a809ec..649e50a8f9dd 100644
--- a/tools/arch/x86/include/uapi/asm/kvm.h
+++ b/tools/arch/x86/include/uapi/asm/kvm.h
@@ -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 */
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 8899201d5964..6ba2928f8f18 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -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, \
--
2.38.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/4] KVM: Reference to kvm_userspace_memory_region in doc and comments
2022-12-02 10:50 [PATCH v2 0/4] KVM: Delete all references to removed ioctls Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 1/4] KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 2/4] KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl Javier Martinez Canillas
@ 2022-12-02 10:50 ` Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 4/4] KVM: Add missing arch for KVM_CREATE_DEVICE and KVM_{SET,GET}_DEVICE_ATTR Javier Martinez Canillas
2022-12-02 17:55 ` [PATCH v2 0/4] KVM: Delete all references to removed ioctls Paolo Bonzini
4 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-12-02 10:50 UTC (permalink / raw)
To: linux-kernel
Cc: Paolo Bonzini, Sergio Lopez Pascual, Sean Christopherson,
Javier Martinez Canillas, Arnaldo Carvalho de Melo, Guang Zeng,
Gustavo A. R. Silva, Jing Liu, Jonathan Corbet, Nicholas Piggin,
Wei Wang, kvm, linux-doc
There 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.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
(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(-)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index 85a5b12eb017..b15ea129f9cf 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -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)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 18592bdf4c1b..759ed18dabb7 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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)
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 6ba2928f8f18..e42be6b45b9b 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -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)
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 6ba2928f8f18..21d6d29502e4 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -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)
--
2.38.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 4/4] KVM: Add missing arch for KVM_CREATE_DEVICE and KVM_{SET,GET}_DEVICE_ATTR
2022-12-02 10:50 [PATCH v2 0/4] KVM: Delete all references to removed ioctls Javier Martinez Canillas
` (2 preceding siblings ...)
2022-12-02 10:50 ` [PATCH v2 3/4] KVM: Reference to kvm_userspace_memory_region in doc and comments Javier Martinez Canillas
@ 2022-12-02 10:50 ` Javier Martinez Canillas
2022-12-02 17:55 ` [PATCH v2 0/4] KVM: Delete all references to removed ioctls Paolo Bonzini
4 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-12-02 10:50 UTC (permalink / raw)
To: linux-kernel
Cc: Paolo Bonzini, Sergio Lopez Pascual, Sean Christopherson,
Javier Martinez Canillas, Jonathan Corbet, kvm, linux-doc
The ioctls are missing an architecture property that is present in others.
Suggested-by: Sergio Lopez Pascual <slp@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
(no changes since v1)
Documentation/virt/kvm/api.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index b15ea129f9cf..1db60cd9e1ba 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -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
--
2.38.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/4] KVM: Delete all references to removed ioctls
2022-12-02 10:50 [PATCH v2 0/4] KVM: Delete all references to removed ioctls Javier Martinez Canillas
` (3 preceding siblings ...)
2022-12-02 10:50 ` [PATCH v2 4/4] KVM: Add missing arch for KVM_CREATE_DEVICE and KVM_{SET,GET}_DEVICE_ATTR Javier Martinez Canillas
@ 2022-12-02 17:55 ` Paolo Bonzini
4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2022-12-02 17:55 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Sergio Lopez Pascual, Sean Christopherson,
Arnaldo Carvalho de Melo, Borislav Petkov, Dan Williams,
Dave Hansen, Fabiano Rosas, Guang Zeng, Gustavo A . R . Silva,
H . Peter Anvin, Ingo Molnar, Jing Liu, Jonathan Corbet,
Nicholas Piggin, Thomas Gleixner, Wei Wang, Yang Zhong, kvm,
linux-doc, x86
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-12-02 17:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-02 10:50 [PATCH v2 0/4] KVM: Delete all references to removed ioctls Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 1/4] KVM: Delete all references to removed KVM_SET_MEMORY_REGION ioctl Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 2/4] KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 3/4] KVM: Reference to kvm_userspace_memory_region in doc and comments Javier Martinez Canillas
2022-12-02 10:50 ` [PATCH v2 4/4] KVM: Add missing arch for KVM_CREATE_DEVICE and KVM_{SET,GET}_DEVICE_ATTR Javier Martinez Canillas
2022-12-02 17:55 ` [PATCH v2 0/4] KVM: Delete all references to removed ioctls Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).