Skip to contentSkip to conversation

MAINTAINERS: KVM tweaks and additions

RFC PATCH Superseded Sean Christopherson 3 participants 15 messages Apr 28 – Apr 30

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sean Christopherson

author maintainer
#0 lore raw

cover MAINTAINERS: KVM tweaks and additions

A few tangentially related KVM MAINTAINERS updates. RFC as I haven't run these ideas by anyone. Feedback is very much wanted, especially on the non-x86 changes (everything except patch 1).

Sean Christopherson (5):
MAINTAINERS: Add kvm-x86 tree to KVM x86 entries
KVM: guest_memfd: Move gmem function declarations to dedicated
guest_memfd.h
MAINTAINERS: Add an entry for KVM's guest_memfd
MAINTAINERS: Add David H. as a KVM guest_memfd reviewer
MAINTAINERS: Add myself (Sean) as a reviewer in the main KVM entry

 MAINTAINERS            | 14 ++++++++++++++
 virt/kvm/guest_memfd.c |  1 +
 virt/kvm/guest_memfd.h | 34 ++++++++++++++++++++++++++++++++++
 virt/kvm/kvm_main.c    |  1 +
 virt/kvm/kvm_mm.h      | 27 ---------------------------
 5 files changed, 50 insertions(+), 27 deletions(-)
 create mode 100644 virt/kvm/guest_memfd.h

base-commit: 39f1c201b93f4ff71631bac72cff6eb155f976a4

Signature · 1 line
2.54.0.545.g6539524ca2-goog
author maintainer
#1 lore raw

RFC PATCH 1/5 MAINTAINERS: Add kvm-x86 tree to KVM x86 entries

Add the kvm-x86 tree to all KVM x86 entries so that humans, bots, and everything in between can more easily find KVM x86 (and some broader KVM) patches that are targeted for the next kernel release, but haven't yet made their way to the main KVM tree. While the KVM x86 patch flow is documented in Documentation/process/maintainer-kvm-x86.rst, that's very much one-off documentation; random passersbys likely don't know it exists, and it's not suitable for any workflow that's at all automated.

---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)
MAINTAINERS +3 -0
index 2fb1c75afd16..89b470db22de 100644
@@ -14149,6 +14149,7 @@ L:	[email protected]
 S:	Supported
 P:	Documentation/process/maintainer-kvm-x86.rst
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
 F:	arch/x86/include/asm/kvm*
 F:	arch/x86/include/asm/svm.h
 F:	arch/x86/include/asm/vmx*.h
@@ -14419,6 +14420,7 @@ M:	Paolo Bonzini <[email protected]>
 L:	[email protected]
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
 F:	arch/x86/kvm/hyperv.*
 F:	arch/x86/kvm/kvm_onhyperv.*
 F:	arch/x86/kvm/svm/hyperv.*
@@ -14433,6 +14435,7 @@ M:	Paolo Bonzini <[email protected]>
 L:	[email protected]
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
 F:	arch/x86/kvm/xen.*
 
 L3MDEV
Signature · 1 line
2.54.0.545.g6539524ca2-goog
author maintainer
#2 lore raw

RFC PATCH 2/5 KVM: guest_memfd: Move gmem function declarations to dedicated guest_memfd.h

In reply to Sean Christopherson

Extract the gmem function declarations out of kvm_mm.h and into a dedicated header, guest_memfd.h. This will allow creating a MAINTAINERS entry for guest_memfd without having to rely on content pattern matching.

---
 virt/kvm/guest_memfd.c |  1 +
 virt/kvm/guest_memfd.h | 34 ++++++++++++++++++++++++++++++++++
 virt/kvm/kvm_main.c    |  1 +
 virt/kvm/kvm_mm.h      | 27 ---------------------------
 4 files changed, 36 insertions(+), 27 deletions(-)
 create mode 100644 virt/kvm/guest_memfd.h
virt/kvm/guest_memfd.c +1 -0
index 69c9d6d546b2..a93a31568337 100644
@@ -9,6 +9,7 @@
 #include <linux/pagemap.h>
 
 #include "kvm_mm.h"
+#include "guest_memfd.h"
 
 static struct vfsmount *kvm_gmem_mnt;
 
virt/kvm/guest_memfd.h new file +34 -0
new file mode 100644
index 000000000000..e8b825da264b
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __KVM_GUEST_MEMFD_H__
+#define __KVM_GUEST_MEMFD_H__
+
+#include <linux/kvm_types.h>
+
+#ifdef CONFIG_KVM_GUEST_MEMFD
+int kvm_gmem_init(struct module *module);
+void kvm_gmem_exit(void);
+int kvm_gmem_create(struct kvm *kvm, struct kvm_create_guest_memfd *args);
+int kvm_gmem_bind(struct kvm *kvm, struct kvm_memory_slot *slot,
+		  unsigned int fd, loff_t offset);
+void kvm_gmem_unbind(struct kvm_memory_slot *slot);
+#else
+static inline int kvm_gmem_init(struct module *module)
+{
+	return 0;
+}
+static inline void kvm_gmem_exit(void) {};
+static inline int kvm_gmem_bind(struct kvm *kvm,
+					 struct kvm_memory_slot *slot,
+					 unsigned int fd, loff_t offset)
+{
+	WARN_ON_ONCE(1);
+	return -EIO;
+}
+
+static inline void kvm_gmem_unbind(struct kvm_memory_slot *slot)
+{
+	WARN_ON_ONCE(1);
+}
+#endif /* CONFIG_KVM_GUEST_MEMFD */
+
+#endif /* __KVM_GUEST_MEMFD_H__ */
virt/kvm/kvm_main.c +1 -0
index 89489996fbc1..a4035ffb421f 100644
@@ -56,6 +56,7 @@
 
 #include "coalesced_mmio.h"
 #include "async_pf.h"
+#include "guest_memfd.h"
 #include "kvm_mm.h"
 #include "vfio.h"
 
virt/kvm/kvm_mm.h +0 -27
index 9fcc5d5b7f8d..4958c0a93d64 100644
@@ -67,31 +67,4 @@ static inline void gfn_to_pfn_cache_invalidate_start(struct kvm *kvm,
 }
 #endif /* HAVE_KVM_PFNCACHE */
 
-#ifdef CONFIG_KVM_GUEST_MEMFD
-int kvm_gmem_init(struct module *module);
-void kvm_gmem_exit(void);
-int kvm_gmem_create(struct kvm *kvm, struct kvm_create_guest_memfd *args);
-int kvm_gmem_bind(struct kvm *kvm, struct kvm_memory_slot *slot,
-		  unsigned int fd, loff_t offset);
-void kvm_gmem_unbind(struct kvm_memory_slot *slot);
-#else
-static inline int kvm_gmem_init(struct module *module)
-{
-	return 0;
-}
-static inline void kvm_gmem_exit(void) {};
-static inline int kvm_gmem_bind(struct kvm *kvm,
-					 struct kvm_memory_slot *slot,
-					 unsigned int fd, loff_t offset)
-{
-	WARN_ON_ONCE(1);
-	return -EIO;
-}
-
-static inline void kvm_gmem_unbind(struct kvm_memory_slot *slot)
-{
-	WARN_ON_ONCE(1);
-}
-#endif /* CONFIG_KVM_GUEST_MEMFD */
-
 #endif /* __KVM_MM_H__ */
Signature · 1 line
2.54.0.545.g6539524ca2-goog
reviewer Acked-by on v1 2/5
#3 lore raw

Re: [RFC PATCH 2/5] KVM: guest_memfd: Move gmem function declarations to dedicated guest_memfd.h

Quoted 6 lines · Sean Christopherson

Extract the gmem function declarations out of kvm_mm.h and into a dedicated header, guest_memfd.h. This will allow creating a MAINTAINERS entry for guest_memfd without having to rely on content pattern matching.

---

Signature · 3 lines
Cheers,

David
Reviewed-by on v1 2/5
#4 lore raw

Re: [RFC PATCH 2/5] KVM: guest_memfd: Move gmem function declarations to dedicated guest_memfd.h

In reply to Sean Christopherson
Quoted 4 lines · Sean Christopherson

Extract the gmem function declarations out of kvm_mm.h and into a dedicated header, guest_memfd.h. This will allow creating a MAINTAINERS entry for guest_memfd without having to rely on content pattern matching.

This also trims kvm_mm.h, which makes it easier to look stuff up. Thanks!

Shall we do something similar for include/linux/kvm_host.h?

Quoted 12 lines
---
 virt/kvm/guest_memfd.c |  1 +
 virt/kvm/guest_memfd.h | 34 ++++++++++++++++++++++++++++++++++
 virt/kvm/kvm_main.c    |  1 +
 virt/kvm/kvm_mm.h      | 27 ---------------------------
 4 files changed, 36 insertions(+), 27 deletions(-)
 create mode 100644 virt/kvm/guest_memfd.h

[...snip...]

author maintainer
#5 lore raw

Re: [RFC PATCH 2/5] KVM: guest_memfd: Move gmem function declarations to dedicated guest_memfd.h

Quoted 11 lines · Ackerley Tng
Quoted 4 lines · Sean Christopherson

Extract the gmem function declarations out of kvm_mm.h and into a dedicated header, guest_memfd.h. This will allow creating a MAINTAINERS entry for guest_memfd without having to rely on content pattern matching.

This also trims kvm_mm.h, which makes it easier to look stuff up. Thanks!

Shall we do something similar for include/linux/kvm_host.h?

LOL, we can try. :-)

Not for linux/kvm_host.h, but I've tried to carve up x86's asm/kvm_host.h on multiple occassions, and have failed miserably every time.

But linux/kvm_host.h is probably less intertwined? Though I think we should split out headers if and only if there's substantial .c content as well. E.g. if we add kvm_memslots.h, then I would also want kvm_memslots.c, because having a dedicated headers while leaving the vast majority of memslots code in the common kvm_main.c would be kludgy.

author maintainer
#6 lore raw

RFC PATCH 3/5 MAINTAINERS: Add an entry for KVM's guest_memfd

In reply to Sean Christopherson

To better reflect how guest_memfd has been maintained for the last few years, and to prepare for significant upcoming growth and expansion, add a dedicated MAINTAINERS entry for KVM's guest_memfd, with Paolo and myself (Sean) as co-maintainers.

List both the KVM and KVM x86 git trees as authoritative repositories, as any given guest_memfd change has a equal odds of hitting KVM x86 or not.

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
index 89b470db22de..9eceeb6f699d 100644
@@ -14396,6 +14396,15 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
 F:	drivers/video/backlight/ktz8866.c
 
+KVM GUEST_MEMFD
+M:	Sean Christopherson <[email protected]>
+M:	Paolo Bonzini <[email protected]>
+L:	[email protected]
+S:	Supported
+T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
+F:	virt/kvm/guest_memfd.*
+
 KVM PARAVIRT (KVM/paravirt)
 M:	Paolo Bonzini <[email protected]>
 R:	Vitaly Kuznetsov <[email protected]>
Signature · 1 line
2.54.0.545.g6539524ca2-goog
#7 lore raw

Re: [RFC PATCH 3/5] MAINTAINERS: Add an entry for KVM's guest_memfd

Quoted 20 lines · Sean Christopherson

To better reflect how guest_memfd has been maintained for the last few years, and to prepare for significant upcoming growth and expansion, add a dedicated MAINTAINERS entry for KVM's guest_memfd, with Paolo and myself (Sean) as co-maintainers.

List both the KVM and KVM x86 git trees as authoritative repositories, as any given guest_memfd change has a equal odds of hitting KVM x86 or not.

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +0 -0
index 89b470db22de..9eceeb6f699d 100644
@@ -14396,6 +14396,15 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
 F:	drivers/video/backlight/ktz8866.c

MAINTAINERS S: Maintained · line 14407

Quoted 10 lines
MAINTAINERS +8 -0
 
+KVM GUEST_MEMFD
+M:	Sean Christopherson <[email protected]>
+M:	Paolo Bonzini <[email protected]>
+L:	[email protected]
+S:	Supported
+T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
+F:	virt/kvm/guest_memfd.*
 

LGTM. There is still the open question regarding other hypervisors, and it having to move out of virt/kvm at some point.

For the time being, this is the right thing to do.

Signature · 3 lines
Cheers,

David
#8 lore raw

Re: [RFC PATCH 3/5] MAINTAINERS: Add an entry for KVM's guest_memfd

In reply to Sean Christopherson
Quoted 19 lines · Sean Christopherson

To better reflect how guest_memfd has been maintained for the last few years, and to prepare for significant upcoming growth and expansion, add a dedicated MAINTAINERS entry for KVM's guest_memfd, with Paolo and myself (Sean) as co-maintainers.

List both the KVM and KVM x86 git trees as authoritative repositories, as any given guest_memfd change has a equal odds of hitting KVM x86 or not.

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +0 -0
index 89b470db22de..9eceeb6f699d 100644
@@ -14396,6 +14396,15 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml

MAINTAINERS S: Maintained · line 14406

Quoted 10 lines
MAINTAINERS +8 -0
 F:	drivers/video/backlight/ktz8866.c
 
+KVM GUEST_MEMFD
+M:	Sean Christopherson <[email protected]>
+M:	Paolo Bonzini <[email protected]>
+L:	[email protected]
+S:	Supported
+T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
+F:	virt/kvm/guest_memfd.*

Should selftests for guest_memfd be added here too?

Quoted 6 lines
MAINTAINERS +1 -1
+
 KVM PARAVIRT (KVM/paravirt)
 M:	Paolo Bonzini <[email protected]>
 R:	Vitaly Kuznetsov <[email protected]>
--

2.54.0.545.g6539524ca2-goog

author maintainer
#9 lore raw

Re: [RFC PATCH 3/5] MAINTAINERS: Add an entry for KVM's guest_memfd

Quoted 23 lines · Ackerley Tng
Quoted 21 lines · Sean Christopherson

To better reflect how guest_memfd has been maintained for the last few years, and to prepare for significant upcoming growth and expansion, add a dedicated MAINTAINERS entry for KVM's guest_memfd, with Paolo and myself (Sean) as co-maintainers.

List both the KVM and KVM x86 git trees as authoritative repositories, as any given guest_memfd change has a equal odds of hitting KVM x86 or not.

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +0 -0
index 89b470db22de..9eceeb6f699d 100644
@@ -14396,6 +14396,15 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
 F:	drivers/video/backlight/ktz8866.c
 
Quoted 10 lines

MAINTAINERS S: Maintained · line 14406

Quoted 8 lines
MAINTAINERS +8 -0
+KVM GUEST_MEMFD
+M:	Sean Christopherson <[email protected]>
+M:	Paolo Bonzini <[email protected]>
+L:	[email protected]
+S:	Supported
+T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+T:	git https://github.com/kvm-x86/linux.git
+F:	virt/kvm/guest_memfd.*

Should selftests for guest_memfd be added here too?

Hmm, no? I don't think I want to go to that level of granularity for selftests, at least not at this time. Maybe if we end up with a large collection of guest_memfd specific, arch-agnostic tests, then we could extend the entry? But even then, I don't think I want to go that route.

Much of the guest_memfd functionality and testing is in common files and/or arch-specific code, e.g. a lot of the truly core functionality is in lib/kvm_util.c, and set_memory_region_test.c and x86/private_mem_conversions_test.c have about as much guest_memfd testing as guest_memfd_test.c. I worry that adding a selftests clause to KVM GUEST_MEMFD would do more harm than good, e.g. create expectations that guest_memfd testing should be isolated and/or be reviewed differently or something, without actually making it easier to maintain the tests.

author maintainer
#10 lore raw

RFC PATCH 4/5 MAINTAINERS: Add David H. as a KVM guest_memfd reviewer

In reply to Sean Christopherson

Officially "reward" David with guest_memfd responsibilities and authority, as he's been instrumental in pushing guest_memfd forward, and his ongoing input and feedback, especially from an mm/ perspective, is and will be critical to keeping us virtualization folks from going too far off the rails.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 9eceeb6f699d..8dd5cdbef66f 100644
@@ -14399,6 +14399,7 @@ F:	drivers/video/backlight/ktz8866.c
 KVM GUEST_MEMFD
 M:	Sean Christopherson <[email protected]>
 M:	Paolo Bonzini <[email protected]>
+R:	David Hildenbrand <[email protected]>
 L:	[email protected]
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
Signature · 1 line
2.54.0.545.g6539524ca2-goog
reviewer Acked-by on v1 4/5
#11 lore raw

Re: [RFC PATCH 4/5] MAINTAINERS: Add David H. as a KVM guest_memfd reviewer

Quoted 5 lines · Sean Christopherson

Officially "reward" David with guest_memfd responsibilities and authority, as he's been instrumental in pushing guest_memfd forward, and his ongoing input and feedback, especially from an mm/ perspective, is and will be critical to keeping us virtualization folks from going too far off the rails.

Thanks for the kind words, Sean!

Quoted 19 lines
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 9eceeb6f699d..8dd5cdbef66f 100644
@@ -14399,6 +14399,7 @@ F:	drivers/video/backlight/ktz8866.c
 KVM GUEST_MEMFD
 M:	Sean Christopherson <[email protected]>
 M:	Paolo Bonzini <[email protected]>
+R:	David Hildenbrand <[email protected]>
 L:	[email protected]
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
Signature · 3 lines
Cheers,

David
#12 lore raw

Re: [RFC PATCH 4/5] MAINTAINERS: Add David H. as a KVM guest_memfd reviewer

Quoted 11 lines · David Hildenbrand (Arm)
Quoted 5 lines · Sean Christopherson

Officially "reward" David with guest_memfd responsibilities and authority, as he's been instrumental in pushing guest_memfd forward, and his ongoing input and feedback, especially from an mm/ perspective, is and will be critical to keeping us virtualization folks from going too far off the rails.

Thanks for the kind words, Sean!

Thank you David!

Quoted 25 lines
Quoted 12 lines
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +0 -0
index 9eceeb6f699d..8dd5cdbef66f 100644

MAINTAINERS F: drivers/video/backlight/ktz8866.c · line 14405

Quoted 7 lines
MAINTAINERS +1 -0
@@ -14399,6 +14399,7 @@ F:	drivers/video/backlight/ktz8866.c
 KVM GUEST_MEMFD
 M:	Sean Christopherson <[email protected]>
 M:	Paolo Bonzini <[email protected]>
+R:	David Hildenbrand <[email protected]>
 L:	[email protected]
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git

--
Cheers,

David

author maintainer
#13 lore raw

RFC PATCH 5/5 MAINTAINERS: Add myself (Sean) as a reviewer in the main KVM entry

In reply to Sean Christopherson

Add myself as a reviewer for overall KVM, as I have been helping shepherd a decent chunk of the virt/kvm commits into the kernel over the last few years, and I expect to continue doing so. Of the 270 non-merge commits that have been made to virt/kvm since v6.6, I have committed 127 (~47%) and Paolo has committed 117 (~43.3%), with all but 5 of the remaining 26 coming from non-KVM folks, e.g. from treewide changes.

Note, this intended to purely be an efficiency and quality of life improvement, for both contributors and myself. There is no implied right of succession or anything of the sort.

Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Tianrui Zhao <[email protected]>
Cc Bibo Mao <[email protected]>
Cc Huacai Chen <[email protected]>
Cc Anup Patel <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Claudio Imbrenda <[email protected]>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 8dd5cdbef66f..a9f2a7737547 100644
@@ -14034,6 +14034,7 @@ F:	kernel/umh.c
 
 KERNEL VIRTUAL MACHINE (KVM)
 M:	Paolo Bonzini <[email protected]>
+R:	Sean Christopherson <[email protected]>
 L:	[email protected]
 S:	Supported
 W:	http://www.linux-kvm.org
Signature · 1 line
2.54.0.545.g6539524ca2-goog
#14 lore raw

Re: [RFC PATCH 5/5] MAINTAINERS: Add myself (Sean) as a reviewer in the main KVM entry

Quoted 30 lines · Sean Christopherson

Add myself as a reviewer for overall KVM, as I have been helping shepherd a decent chunk of the virt/kvm commits into the kernel over the last few years, and I expect to continue doing so. Of the 270 non-merge commits that have been made to virt/kvm since v6.6, I have committed 127 (~47%) and Paolo has committed 117 (~43.3%), with all but 5 of the remaining 26 coming from non-KVM folks, e.g. from treewide changes.

Note, this intended to purely be an efficiency and quality of life improvement, for both contributors and myself. There is no implied right of succession or anything of the sort.

Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Tianrui Zhao <[email protected]>
Cc Bibo Mao <[email protected]>
Cc Huacai Chen <[email protected]>
Cc Anup Patel <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Janosch Frank <[email protected]>
Cc Claudio Imbrenda <[email protected]>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +0 -0
index 8dd5cdbef66f..a9f2a7737547 100644

MAINTAINERS F: kernel/umh.c · line 14040

Quoted 7 lines
MAINTAINERS +1 -0
@@ -14034,6 +14034,7 @@ F:	kernel/umh.c
 
 KERNEL VIRTUAL MACHINE (KVM)
 M:	Paolo Bonzini <[email protected]>
+R:	Sean Christopherson <[email protected]>
 L:	[email protected]
 S:	Supported
 W:	http://www.linux-kvm.org

I believe any bigger subsystem should have a backup in place. If that's spelled out through an M or R depends on the subsystem.

Certainly LGTM, but if you would have made that an M, I would also not have been struck by surprise (up to you and Paolo to figure out) :)

Signature · 3 lines
Cheers,

David