On 3/20/24 09:39, Michael Roth wrote:
+if (cap_user_memory2 == -1) {
+cap_user_memory2 = kvm_check_extension(s, KVM_CAP_USER_MEMORY2);
+}
+
+if (!cap_user_memory2 && slot->guest_memfd >= 0) {
+error_report("%s, KVM doesn't support KVM_CAP_USER_MEMORY2,"
+
From: Chao Peng
Switch to KVM_SET_USER_MEMORY_REGION2 when supported by KVM.
With KVM_SET_USER_MEMORY_REGION2, QEMU can set up memory region that
backend'ed both by hva-based shared memory and guest memfd based private
memory.
Signed-off-by: Chao Peng
Co-developed-by: Xiaoyao Li