diff options
| author | Sean Christopherson <seanjc@google.com> | 2026-07-23 14:08:04 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-07-27 09:42:42 -0700 |
| commit | 7b8529e70a11ed110a15568f6b391a5f32eef67f (patch) | |
| tree | ca1a9b8a29415744f086f941cadff50e556dff12 /include/linux/timerqueue_types.h | |
| parent | 0f0893ac5af3ac9d18440955f302bd20a35ccab2 (diff) | |
KVM: guest_memfd: Rename invalidate() arch hook to reclaim() and isolate it
Rename guest_memfd's invalidate() hook to reclaim() and isolate it via its
own RECLAIM Kconfig, as the hook is called when a folio is freed, which is
far too late and lacks sufficient information for KVM to actually
invalidate its usage of the memory. E.g. SNP uses the hook to convert
memory back to SHARED so that it can be safely accessed by the host, there
is no invalidation of guest mappings anywhere. Isolating the hook will
also allow pKVM on arm64 to opt-in to reclaim() without also having to
differentiate between reclaim and conversions to shared for active VMs.
Keep guest_memfd's trampoline, even though it would be trivial to wire up
.free_folio() directly to an arch callback, to avoid bleeding guest_memfd
internals into arch code (specifically, avoid referencing folios in arch
code).
Leave the kvm_x86_ops hook as-is for the moment, as "reclaim" on SNP is
the same as convert-to-shared, i.e. using a different name for the x86 hook
will allow reusing it for in-place conversion.
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Fuad Tabba <fuad.tabba@linux.dev>
Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Link: https://patch.msgid.link/20260723210811.72720-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'include/linux/timerqueue_types.h')
0 files changed, 0 insertions, 0 deletions
