diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-07-11 18:27:55 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-07-26 14:46:15 -0400 |
commit | e4ee5447927377c55777b73fe497a2455a25f948 (patch) | |
tree | a6ffb957b0a7f357327572395b8a08801a9ea0b1 /drivers/crypto/img-hash.c | |
parent | 4b5f67120a88c713b82907d55a767693382e9e9d (diff) |
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 'drivers/crypto/img-hash.c')
0 files changed, 0 insertions, 0 deletions