KVM: kvm_set_memory_region() cleanups
Sean Christopherson
maintainerv2 cover KVM: kvm_set_memory_region() cleanups
Cleanups related to kvm_set_memory_region(), salvaged from similar patches that were flying around when we were sorting out KVM_SET_USER_MEMORY_REGION2.
And, hopefully, the KVM-internal memslots hardening will also be useful for s390's ucontrol stuff (https://lore.kernel.org/all/[email protected]).
v2:
- Keep check_memory_region_flags() where it is. [Xiaoyao]
- Rework the changelog for the last patch to account for the change in motiviation.
- Fix double spaces goofs. [Tao]
- Add a lockdep assertion in the x86 code, too. [Tao]
v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (5):
KVM: Open code kvm_set_memory_region() into its sole caller (ioctl()
API)
KVM: Assert slots_lock is held when setting memory regions
KVM: Add a dedicated API for setting KVM-internal memslots
KVM: x86: Drop double-underscores from __kvm_set_memory_region()
KVM: Disallow all flags for KVM-internal memslots
arch/x86/kvm/x86.c | 7 ++++--- include/linux/kvm_host.h | 8 +++----- virt/kvm/kvm_main.c | 33 ++++++++++++++------------------- 3 files changed, 21 insertions(+), 27 deletions(-)
base-commit: 10b2c8a67c4b8ec15f9d07d177f63b563418e948
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Sean Christopherson
maintainerPATCH v2 1/5 KVM: Open code kvm_set_memory_region() into its sole caller (ioctl() API)
Open code kvm_set_memory_region() into its sole caller in preparation for adding a dedicated API for setting internal memslots.
Oppurtunistically use the fancy new guard(mutex) to avoid a local 'r' variable.
--- include/linux/kvm_host.h | 2 -- virt/kvm/kvm_main.c | 15 ++------------- 2 files changed, 2 insertions(+), 15 deletions(-)
include/linux/kvm_host.h +0 -2
@@ -1192,8 +1192,6 @@ enum kvm_mr_change { KVM_MR_FLAGS_ONLY, }; -int kvm_set_memory_region (struct kvm *kvm, -const struct kvm_userspace_memory_region2 *mem);int __kvm_set_memory_region (struct kvm *kvm,const struct kvm_userspace_memory_region2 *mem);void kvm_arch_free_memslot (struct kvm *kvm,struct kvm_memory_slot *slot);
virt/kvm/kvm_main.c +2 -13
@@ -2058,25 +2058,14 @@ int __kvm_set_memory_region(struct kvm *kvm, }EXPORT_SYMBOL_GPL (__kvm_set_memory_region); -int kvm_set_memory_region (struct kvm *kvm, -const struct kvm_userspace_memory_region2 *mem) -{ -int r; - -mutex_lock (&kvm->slots_lock); - r =__kvm_set_memory_region (kvm, mem); -mutex_unlock (&kvm->slots_lock); -return r; -} -EXPORT_SYMBOL_GPL (kvm_set_memory_region); -static int kvm_vm_ioctl_set_memory_region (struct kvm *kvm,struct kvm_userspace_memory_region2 *mem) {if ((u16 )mem->slot >=KVM_USER_MEM_SLOTS )return -EINVAL ; -return kvm_set_memory_region (kvm, mem); +guard (mutex)(&kvm->slots_lock); +return __kvm_set_memory_region (kvm, mem); }#ifndef CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Sean Christopherson
maintainerPATCH v2 2/5 KVM: Assert slots_lock is held when setting memory regions
In reply to Sean ChristophersonAdd proper lockdep assertions in __kvm_set_memory_region() and __x86_set_memory_region() instead of relying comments.
Opportunistically delete __kvm_set_memory_region()'s entire function comment as the API doesn't allocate memory or select a gfn, and the "mostly for framebuffers" comment hasn't been true for a very long time.
--- arch/x86/kvm/x86.c | 3 ++- virt/kvm/kvm_main.c | 10 ++-------- 2 files changed, 4 insertions(+), 9 deletions(-)
arch/x86/kvm/x86.c +2 -1
@@ -12793,7 +12793,8 @@ void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa,struct kvm_memslots *slots =kvm_memslots (kvm);struct kvm_memory_slot *slot; -/* Called with kvm->slots_lock held. */ +lockdep_assert_held (&kvm->slots_lock); +if (WARN_ON (id >=KVM_MEM_SLOTS_NUM ))return ERR_PTR_USR (-EINVAL );
virt/kvm/kvm_main.c +2 -8
@@ -1926,14 +1926,6 @@ static bool kvm_check_memslot_overlap(struct kvm_memslots *slots, int id,return false; } -/* -* Allocate some memory and give it an address in the guest physical address -* space. -* -* Discontiguous memory is allowed, mostly for framebuffers. -* -* Must be called holding kvm->slots_lock for write. -*/ int __kvm_set_memory_region (struct kvm *kvm,const struct kvm_userspace_memory_region2 *mem) {
@@ -1945,6 +1937,8 @@ int __kvm_set_memory_region(struct kvm *kvm,int as_id, id;int r; +lockdep_assert_held (&kvm->slots_lock); + r =check_memory_region_flags (kvm, mem);if (r)return r;
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Sean Christopherson
maintainerPATCH v2 3/5 KVM: Add a dedicated API for setting KVM-internal memslots
In reply to Sean ChristophersonAdd a dedicated API for setting internal memslots, and have it explicitly disallow setting userspace memslots. Setting a userspace memslots without a direct command from userspace would result in all manner of issues.
No functional change intended.
--- arch/x86/kvm/x86.c | 2 +- include/linux/kvm_host.h | 4 ++-- virt/kvm/kvm_main.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-)
arch/x86/kvm/x86.c +1 -1
@@ -12827,7 +12827,7 @@ void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, m.guest_phys_addr = gpa; m.userspace_addr = hva; m.memory_size = size; - r =__kvm_set_memory_region (kvm, &m); + r =kvm_set_internal_memslot (kvm, &m);if (r <0 )return ERR_PTR_USR (r); }
include/linux/kvm_host.h +2 -2
@@ -1192,8 +1192,8 @@ enum kvm_mr_change { KVM_MR_FLAGS_ONLY, }; -int __kvm_set_memory_region (struct kvm *kvm, -const struct kvm_userspace_memory_region2 *mem); +int kvm_set_internal_memslot (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem);void kvm_arch_free_memslot (struct kvm *kvm,struct kvm_memory_slot *slot);void kvm_arch_memslots_updated (struct kvm *kvm,u64 gen); int kvm_arch_prepare_memory_region(struct kvm *kvm,
virt/kvm/kvm_main.c +12 -3
@@ -1926,8 +1926,8 @@ static bool kvm_check_memslot_overlap(struct kvm_memslots *slots, int id,return false; } -int __kvm_set_memory_region (struct kvm *kvm, -const struct kvm_userspace_memory_region2 *mem) +static int __kvm_set_memory_region (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) {struct kvm_memory_slot *old, *new;struct kvm_memslots *slots;
@@ -2050,7 +2050,16 @@ int __kvm_set_memory_region(struct kvm *kvm,kfree (new);return r; } -EXPORT_SYMBOL_GPL (__kvm_set_memory_region); + +int kvm_set_internal_memslot (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) +{ +if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS )) +return -EINVAL ; + +return __kvm_set_memory_region (kvm, mem); +} +EXPORT_SYMBOL_GPL (kvm_set_internal_memslot);static int kvm_vm_ioctl_set_memory_region (struct kvm *kvm,struct kvm_userspace_memory_region2 *mem)
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Re: [PATCH v2 3/5] KVM: Add a dedicated API for setting KVM-internal memslots
Quoted 15 lines · Sean Christopherson
Add a dedicated API for setting internal memslots, and have it explicitly disallow setting userspace memslots. Setting a userspace memslots without a direct command from userspace would result in all manner of issues.
No functional change intended.
Cc Tao Su <[email protected]>Cc Claudio Imbrenda <[email protected]>Cc Christian Borntraeger <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- arch/x86/kvm/x86.c | 2 +- include/linux/kvm_host.h | 4 ++-- virt/kvm/kvm_main.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-)
[...]
virt/kvm/kvm_main.c int __kvm_set_memory_region(struct kvm *kvm, · line 2059
Quoted 6 lines
virt/kvm/kvm_main.c +6
-0+int kvm_set_internal_memslot (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) +{ +if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS )) +return -EINVAL ; +
Looking at Claudios changes I found that this is missing to acquire the slots_lock here.
guard(mutex)(&kvm->slots_lock);
Quoted 6 lines
virt/kvm/kvm_main.c +3
-0+return __kvm_set_memory_region (kvm, mem); +} +EXPORT_SYMBOL_GPL (kvm_set_internal_memslot);static int kvm_vm_ioctl_set_memory_region (struct kvm *kvm,struct kvm_userspace_memory_region2 *mem)
Sean Christopherson
maintainerRe: [PATCH v2 3/5] KVM: Add a dedicated API for setting KVM-internal memslots
Quoted 29 lines · Christoph Schlameuss
Quoted 15 lines · Sean Christopherson
Add a dedicated API for setting internal memslots, and have it explicitly disallow setting userspace memslots. Setting a userspace memslots without a direct command from userspace would result in all manner of issues.
No functional change intended.
Cc Tao Su <[email protected]>Cc Claudio Imbrenda <[email protected]>Cc Christian Borntraeger <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- arch/x86/kvm/x86.c | 2 +- include/linux/kvm_host.h | 4 ++-- virt/kvm/kvm_main.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-)[...]
virt/kvm/kvm_main.c int __kvm_set_memory_region(struct kvm *kvm, · line 2059
Quoted 6 lines
virt/kvm/kvm_main.c +6
-0+int kvm_set_internal_memslot (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) +{ +if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS )) +return -EINVAL ; +Looking at Claudios changes I found that this is missing to acquire the
slots_lockhere.
Quoted 1 line
guard(mutex)(&kvm->slots_lock);
It's not missing. As of this patch, x86 is the only user of KVM-internal memslots, and x86 acquires slots_lock outside of kvm_set_internal_memslot() because x86 can have multiple address spaces (regular vs SMM) and KVM's internal memslots need to be created for both, i.e. it's desirable to holds slots_lock in the caller.
If it's annoying for s390 to acquire slots_lock, we could add a wrapper, i.e. turn this into __kvm_set_internal_memslot() and then re-add kvm_set_internal_memslot() as a version that acquires and releases slots_lock.
Re: [PATCH v2 3/5] KVM: Add a dedicated API for setting KVM-internal memslots
Quoted 32 lines · On Tue, 21 Jan 2025 08:05:57 -0800 Sean Christopherson <[email protected]>…
Quoted 29 lines · Christoph Schlameuss
Quoted 15 lines · Sean Christopherson
Add a dedicated API for setting internal memslots, and have it explicitly disallow setting userspace memslots. Setting a userspace memslots without a direct command from userspace would result in all manner of issues.
No functional change intended.
Cc Tao Su <[email protected]>Cc Claudio Imbrenda <[email protected]>Cc Christian Borntraeger <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- arch/x86/kvm/x86.c | 2 +- include/linux/kvm_host.h | 4 ++-- virt/kvm/kvm_main.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-)[...]
virt/kvm/kvm_main.c int __kvm_set_memory_region(struct kvm *kvm, · line 2059
Quoted 6 lines
virt/kvm/kvm_main.c +6
-0+int kvm_set_internal_memslot (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) +{ +if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS )) +return -EINVAL ; +Looking at Claudios changes I found that this is missing to acquire the
slots_lockhere.Quoted 1 line
guard(mutex)(&kvm->slots_lock);
Quoted 8 lines
It's not missing. As of this patch, x86 is the only user of KVM-internal memslots, and x86 acquires
slots_lockoutside ofkvm_set_internal_memslot()because x86 can have multiple address spaces (regular vs SMM) and KVM's internal memslots need to be created for both, i.e. it's desirable to holdsslots_lockin the caller.If it's annoying for s390 to acquire
slots_lock, we could add a wrapper, i.e. turn this into__kvm_set_internal_memslot()and then re-addkvm_set_internal_memslot()as a version that acquires and releasesslots_lock.
I think it's fine as it is, just document that the lock needs to be held
I'll add the necessary locking in the s390 code
Re: [PATCH v2 3/5] KVM: Add a dedicated API for setting KVM-internal memslots
Quoted 40 lines · Claudio Imbrenda
Quoted 37 lines · On Tue, 21 Jan 2025 08:05:57 -0800 Sean Christopherson <[email protected]>…
Quoted 29 lines · Christoph Schlameuss
Quoted 15 lines · Sean Christopherson
Add a dedicated API for setting internal memslots, and have it explicitly disallow setting userspace memslots. Setting a userspace memslots without a direct command from userspace would result in all manner of issues.
No functional change intended.
Cc Tao Su <[email protected]>Cc Claudio Imbrenda <[email protected]>Cc Christian Borntraeger <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- arch/x86/kvm/x86.c | 2 +- include/linux/kvm_host.h | 4 ++-- virt/kvm/kvm_main.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-)[...]
virt/kvm/kvm_main.c int __kvm_set_memory_region(struct kvm *kvm, · line 2059
Quoted 6 lines
virt/kvm/kvm_main.c +6
-0+int kvm_set_internal_memslot (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) +{ +if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS )) +return -EINVAL ; +Looking at Claudios changes I found that this is missing to acquire the
slots_lockhere.Quoted 1 line
guard(mutex)(&kvm->slots_lock);
It's not missing. As of this patch, x86 is the only user of KVM-internal memslots, and x86 acquires
slots_lockoutside ofkvm_set_internal_memslot()because x86 can have multiple address spaces (regular vs SMM) and KVM's internal memslots need to be created for both, i.e. it's desirable to holdsslots_lockin the caller.
Quoted 8 lines
Quoted 3 lines
If it's annoying for s390 to acquire
slots_lock, we could add a wrapper, i.e. turn this into__kvm_set_internal_memslot()and then re-addkvm_set_internal_memslot()as a version that acquires and releasesslots_lock.I think it's fine as it is, just document that the lock needs to be held
I'll add the necessary locking in the s390 code
I see. Thank you for the elaboration, Sean!
Sean Christopherson
maintainerPATCH v2 4/5 KVM: x86: Drop double-underscores from __kvm_set_memory_region()
In reply to Sean ChristophersonNow that there's no outer wrapper for __kvm_set_memory_region() and it's static, drop its double-underscore prefix.
No functional change intended.
--- arch/x86/kvm/x86.c | 2 +- include/linux/kvm_host.h | 2 +- virt/kvm/kvm_main.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/kvm/x86.c +1 -1
@@ -12928,7 +12928,7 @@ static int kvm_alloc_memslot_metadata(struct kvm *kvm,/* * Clear out the previous array pointers for the KVM_MR_MOVE case. The -* old arrays will be freed by __kvm_set_memory_region() if installing +* old arrays will be freed by kvm_set_memory_region() if installing * the new memslot is successful. */ memset (&slot->arch,0 ,sizeof (slot->arch));
include/linux/kvm_host.h +1 -1
@@ -1183,7 +1183,7 @@ struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn* -- just change its flags * * Since flags can be changed by some of these operations, the following -* differentiation is the best we can do for __kvm_set_memory_region(): +* differentiation is the best we can do for kvm_set_memory_region(): */ enum kvm_mr_change {KVM_MR_CREATE ,
virt/kvm/kvm_main.c +4 -4
@@ -1926,8 +1926,8 @@ static bool kvm_check_memslot_overlap(struct kvm_memslots *slots, int id,return false; } -static int __kvm_set_memory_region (struct kvm *kvm, -const struct kvm_userspace_memory_region2 *mem) +static int kvm_set_memory_region (struct kvm *kvm, +const struct kvm_userspace_memory_region2 *mem) {struct kvm_memory_slot *old, *new;struct kvm_memslots *slots;
@@ -2057,7 +2057,7 @@ int kvm_set_internal_memslot(struct kvm *kvm,if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS ))return -EINVAL ; -return __kvm_set_memory_region (kvm, mem); +return kvm_set_memory_region (kvm, mem); }EXPORT_SYMBOL_GPL (kvm_set_internal_memslot);
@@ -2068,7 +2068,7 @@ static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,return -EINVAL ;guard (mutex)(&kvm->slots_lock); -return __kvm_set_memory_region (kvm, mem); +return kvm_set_memory_region (kvm, mem); }#ifndef CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Sean Christopherson
maintainerPATCH v2 5/5 KVM: Disallow all flags for KVM-internal memslots
In reply to Sean ChristophersonDisallow all flags for KVM-internal memslots as all existing flags require some amount of userspace interaction to have any meaning. In addition to guarding against KVM goofs, explicitly disallowing dirty logging of KVM- internal memslots will (hopefully) allow exempting KVM-internal memslots from the KVM_MEM_MAX_NR_PAGES limit, which appears to exist purely because the dirty bitmap operations use a 32-bit index.
--- virt/kvm/kvm_main.c | 3 +++ 1 file changed, 3 insertions(+)
virt/kvm/kvm_main.c +3 -0
@@ -2057,6 +2057,9 @@ int kvm_set_internal_memslot(struct kvm *kvm,if (WARN_ON_ONCE (mem->slot <KVM_USER_MEM_SLOTS ))return -EINVAL ; +if (WARN_ON_ONCE (mem->flags)) +return -EINVAL ; +return kvm_set_memory_region (kvm, mem); }EXPORT_SYMBOL_GPL (kvm_set_internal_memslot);
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Quoted 5 lines · On Fri, 10 Jan 2025 16:20:17 -0800 Sean Christopherson <[email protected]>…
Cleanups related to
kvm_set_memory_region(), salvaged from similar patches that were flying around when we were sorting outKVM_SET_USER_MEMORY_REGION2.And, hopefully, the KVM-internal memslots hardening will also be useful for s390's ucontrol stuff (https://lore.kernel.org/all/[email protected]).
whole series:
Quoted 25 lines
v2:
- Keepcheck_memory_region_flags()where it is. [Xiaoyao]
- Rework the changelog for the last patch to account for the change in motiviation.
- Fix double spaces goofs. [Tao]
- Add a lockdep assertion in the x86 code, too. [Tao]v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (5):
KVM: Open codekvm_set_memory_region()into its sole caller (ioctl()
API)
KVM: Assertslots_lockis held when setting memory regions
KVM: Add a dedicated API for setting KVM-internal memslots
KVM: x86: Drop double-underscores from__kvm_set_memory_region()
KVM: Disallow all flags for KVM-internal memslotsarch/x86/kvm/x86.c | 7 ++++--- include/linux/kvm_host.h | 8 +++----- virt/kvm/kvm_main.c | 33 ++++++++++++++------------------- 3 files changed, 21 insertions(+), 27 deletions(-)base-commit:
10b2c8a67c4b8ec15f9d07d177f63b563418e948
Quoted 5 lines · Sean Christopherson
Cleanups related to
kvm_set_memory_region(), salvaged from similar patches that were flying around when we were sorting outKVM_SET_USER_MEMORY_REGION2.And, hopefully, the KVM-internal memslots hardening will also be useful for s390's ucontrol stuff (https://lore.kernel.org/all/[email protected]).
Whole series:
Quoted 25 lines
v2:
- Keepcheck_memory_region_flags()where it is. [Xiaoyao]
- Rework the changelog for the last patch to account for the change in motiviation.
- Fix double spaces goofs. [Tao]
- Add a lockdep assertion in the x86 code, too. [Tao]v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (5):
KVM: Open codekvm_set_memory_region()into its sole caller (ioctl()
API)
KVM: Assertslots_lockis held when setting memory regions
KVM: Add a dedicated API for setting KVM-internal memslots
KVM: x86: Drop double-underscores from__kvm_set_memory_region()
KVM: Disallow all flags for KVM-internal memslotsarch/x86/kvm/x86.c | 7 ++++--- include/linux/kvm_host.h | 8 +++----- virt/kvm/kvm_main.c | 33 ++++++++++++++------------------- 3 files changed, 21 insertions(+), 27 deletions(-)base-commit:
10b2c8a67c4b8ec15f9d07d177f63b563418e948
Quoted 5 lines · Sean Christopherson
Cleanups related to
kvm_set_memory_region(), salvaged from similar patches that were flying around when we were sorting outKVM_SET_USER_MEMORY_REGION2.And, hopefully, the KVM-internal memslots hardening will also be useful for s390's ucontrol stuff (https://lore.kernel.org/all/[email protected]).
For the series:
Quoted 24 lines
v2:
- Keepcheck_memory_region_flags()where it is. [Xiaoyao]
- Rework the changelog for the last patch to account for the change in motiviation.
- Fix double spaces goofs. [Tao]
- Add a lockdep assertion in the x86 code, too. [Tao]v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (5):
KVM: Open codekvm_set_memory_region()into its sole caller (ioctl()
API)
KVM: Assertslots_lockis held when setting memory regions
KVM: Add a dedicated API for setting KVM-internal memslots
KVM: x86: Drop double-underscores from__kvm_set_memory_region()
KVM: Disallow all flags for KVM-internal memslotsarch/x86/kvm/x86.c | 7 ++++--- include/linux/kvm_host.h | 8 +++----- virt/kvm/kvm_main.c | 33 ++++++++++++++------------------- 3 files changed, 21 insertions(+), 27 deletions(-)base-commit:
10b2c8a67c4b8ec15f9d07d177f63b563418e948
Quoted 6 lines · Sean Christopherson
Cleanups related to
kvm_set_memory_region(), salvaged from similar patches that were flying around when we were sorting outKVM_SET_USER_MEMORY_REGION2.And, hopefully, the KVM-internal memslots hardening will also be useful for s390's ucontrol stuff (https://lore.kernel.org/all/[email protected]).
Quoted 8 lines
v2:
- Keepcheck_memory_region_flags()where it is. [Xiaoyao]
- Rework the changelog for the last patch to account for the change in motiviation.
- Fix double spaces goofs. [Tao]
- Add a lockdep assertion in the x86 code, too. [Tao][...]
Applied to kvm-x86 memslots, and pushed
https://github.com/kvm-x86/linux tags/kvm-memslots-6.14
as well. Thanks much for the reviews!
[1/5] KVM: Open code kvm_set_memory_region() into its sole caller (ioctl() API)
https://github.com/kvm-x86/linux/commit/f81a6d12bf8b [2/5] KVM: Assert slots_lock is held when setting memory regions https://github.com/kvm-x86/linux/commit/d131f0042f46 [3/5] KVM: Add a dedicated API for setting KVM-internal memslots https://github.com/kvm-x86/linux/commit/156bffdb2b49 [4/5] KVM: x86: Drop double-underscores from __kvm_set_memory_region() https://github.com/kvm-x86/linux/commit/344315e93dbc [5/5] KVM: Disallow all flags for KVM-internal memslots https://github.com/kvm-x86/linux/commit/0cc3cb2151f9