summaryrefslogtreecommitdiff
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-10-24 14:45:08 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2025-10-24 14:45:08 +0200
commit5efbe8ff98aa56c2b537b03c97f2b2b87456acff (patch)
treefef9cca5d2163dc03627a23f751b47792e9dfd10 /include/linux/kvm_host.h
parent57fe8285dc4764171fa9eb1f153cae3bb313d6fc (diff)
parent098456f3141bf9e0c0d8973695ca38a03465ccd6 (diff)
Merge drm/drm-next into drm-misc-next
Backmerging to get fixes and features of v6.18-rc2. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index fa36e70df088..5bd76cf394fa 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -729,7 +729,17 @@ static inline bool kvm_arch_has_private_mem(struct kvm *kvm)
#endif
#ifdef CONFIG_KVM_GUEST_MEMFD
-bool kvm_arch_supports_gmem_mmap(struct kvm *kvm);
+bool kvm_arch_supports_gmem_init_shared(struct kvm *kvm);
+
+static inline u64 kvm_gmem_get_supported_flags(struct kvm *kvm)
+{
+ u64 flags = GUEST_MEMFD_FLAG_MMAP;
+
+ if (!kvm || kvm_arch_supports_gmem_init_shared(kvm))
+ flags |= GUEST_MEMFD_FLAG_INIT_SHARED;
+
+ return flags;
+}
#endif
#ifndef kvm_arch_has_readonly_mem