summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2026-10-19 13:54:07 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2026-10-21 03:24:11 -0400
commit28d5df7b727471439ca343208e5be1fd55338128 (patch)
tree4e1e24a6c42fd1f3b1330549225b6d921c2bcd63 /include/linux
parent3a74cf568b9afd0eaa138bc40308c3ddf0f547bc (diff)
KVM: split CONFIG_KVM_PRIVATE_MEMATTR_VM out of KVM_VM_MEMORY_ATTRIBUTES
With Linux 7.4 the "private" memory attribute was moved from the VM to the individual guest_memfd file descriptor. The old semantics are available for backwards compatibility via CONFIG_KVM_VM_MEMORY_ATTRIBUTES. However, this ties support for VM memory attributes entirely to a backwards compatibility symbol, which is a problem when adding VM memory attributes other than PRIVATE. Thus, make CONFIG_KVM_VM_MEMORY_ATTRIBUTES the equivalent of the old CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES, and use a more descriptive name for the private memory attribute. Do this now, instead of waiting for more attributes to come, before distros start adjusting their build configuration. Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kvm_host.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 4d4e76a50d77..09c57d31d153 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -2582,12 +2582,14 @@ bool kvm_arch_pre_set_vm_memory_attributes(struct kvm *kvm,
struct kvm_gfn_range *range);
bool kvm_arch_post_set_vm_memory_attributes(struct kvm *kvm,
struct kvm_gfn_range *range);
+#endif /* CONFIG_KVM_VM_MEMORY_ATTRIBUTES */
+#ifdef CONFIG_KVM_PRIVATE_MEMATTR_VM
static inline bool kvm_vm_is_private_gfn(struct kvm *kvm, gfn_t gfn)
{
return kvm_get_vm_memory_attributes(kvm, gfn) & KVM_MEMORY_ATTRIBUTE_PRIVATE;
}
-#endif /* CONFIG_KVM_VM_MEMORY_ATTRIBUTES */
+#endif /* CONFIG_KVM_PRIVATE_MEMATTR_VM */
#ifdef kvm_arch_has_private_mem
extern bool gmem_in_place_conversion;