kvm/memory: Make memory type private by default if it has guest memfd backend
authorXiaoyao Li <xiaoyao.li@intel.com>
Wed, 20 Mar 2024 08:39:11 +0000 (03:39 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 23 Apr 2024 15:35:25 +0000 (17:35 +0200)
commitbd3bcf6962b664ca3bf9c60fdcc4534e8e3d0641
treeacbbba5b119e812c3795269915466ccf4ec1cd0d
parentce5a983233b4ca94ced88c9581014346509b5c71
kvm/memory: Make memory type private by default if it has guest memfd backend

KVM side leaves the memory to shared by default, which may incur the
overhead of paging conversion on the first visit of each page. Because
the expectation is that page is likely to private for the VMs that
require private memory (has guest memfd).

Explicitly set the memory to private when memory region has valid
guest memfd backend.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-ID: <20240320083945.991426-16-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c