KVM: Disallow all flags for KVM-internal memslots
authorSean Christopherson <seanjc@google.com>
Sat, 11 Jan 2025 00:20:22 +0000 (16:20 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 15 Jan 2025 01:36:16 +0000 (17:36 -0800)
commit0cc3cb2151f9830274e7bef39a23dc1da1ecd34a
treedbd5c111474fe425e18c12cd46c53bc70b24b5f6
parent344315e93dbc9c4733d5c9fd605ecfc46ef97180
KVM: Disallow all flags for KVM-internal memslots

Disallow 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.

Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Link: https://lore.kernel.org/r/20250111002022.1230573-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
virt/kvm/kvm_main.c