[GIT PULL] KVM: Memslots hardening/cleanups for 6.14

From: Sean Christopherson
Date: Thu Jan 16 2025 - 20:08:05 EST


Please pull a small series to clean up and harden kvm_set_memory_region().
KVM s390 is building on this branch/tag to create a KVM-internal memslot for
its ucontrol stuff, hence the dedicated pull request (and I didn't have any
other pending "generic" changes).

https://lore.kernel.org/all/20250116113355.32184-1-imbrenda@xxxxxxxxxxxxx


The following changes since commit 10b2c8a67c4b8ec15f9d07d177f63b563418e948:

Merge tag 'kvm-x86-fixes-6.13-rcN' of https://github.com/kvm-x86/linux into HEAD (2024-12-22 12:59:33 -0500)

are available in the Git repository at:

https://github.com/kvm-x86/linux.git tags/kvm-memslots-6.14

for you to fetch changes up to 0cc3cb2151f9830274e7bef39a23dc1da1ecd34a:

KVM: Disallow all flags for KVM-internal memslots (2025-01-14 17:36:16 -0800)

----------------------------------------------------------------
KVM kvm_set_memory_region() cleanups and hardening for 6.14:

- Add proper lockdep assertions when setting memory regions.

- Add a dedicated API for setting KVM-internal memory regions.

- Explicitly disallow all flags for KVM-internal memory regions.

----------------------------------------------------------------
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(-)