summaryrefslogtreecommitdiff
path: root/mm/percpu-vm.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-07-12 01:27:55 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2024-07-26 21:46:15 +0300
commite4ee5447927377c55777b73fe497a2455a25f948 (patch)
treea6ffb957b0a7f357327572395b8a08801a9ea0b1 /mm/percpu-vm.c
parent4b5f67120a88c713b82907d55a767693382e9e9d (diff)
downloadlinux-e4ee5447927377c55777b73fe497a2455a25f948.tar.xz
KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns
This check is currently performed by sev_gmem_post_populate(), but it applies to all callers of kvm_gmem_populate(): the point of the function is that the memory is being encrypted and some work has to be done on all the gfns in order to encrypt them. Therefore, check the KVM_MEMORY_ATTRIBUTE_PRIVATE attribute prior to invoking the callback, and stop the operation if a shared page is encountered. Because CONFIG_KVM_PRIVATE_MEM in principle does not require attributes, this makes kvm_gmem_populate() depend on CONFIG_KVM_GENERIC_PRIVATE_MEM (which does require them). Reviewed-by: Michael Roth <michael.roth@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mm/percpu-vm.c')
0 files changed, 0 insertions, 0 deletions