]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: guest_memfd: Add hook for invalidating memory
authorMichael Roth <michael.roth@amd.com>
Sat, 30 Dec 2023 17:23:21 +0000 (11:23 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 May 2024 17:11:48 +0000 (13:11 -0400)
commita90764f0e4ed5350cc9caeb384e0fb356c032587
tree937a1302c4b4ebdcccca9c1a52e40916e7ecb05e
parent1f6c06b177513e8a47c43e95d1985dbd9cff3ddd
KVM: guest_memfd: Add hook for invalidating memory

In some cases, like with SEV-SNP, guest memory needs to be updated in a
platform-specific manner before it can be safely freed back to the host.
Wire up arch-defined hooks to the .free_folio kvm_gmem_aops callback to
allow for special handling of this sort when freeing memory in response
to FALLOC_FL_PUNCH_HOLE operations and when releasing the inode, and go
ahead and define an arch-specific hook for x86 since it will be needed
for handling memory used for SEV-SNP guests.

Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-Id: <20231230172351.574091-6-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm-x86-ops.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
include/linux/kvm_host.h
virt/kvm/Kconfig
virt/kvm/guest_memfd.c