On 9/11/2026 7:55 AM, Ackerley Tng via B4 Relay wrote: > From: Sean Christopherson <[email protected]> > > Add and use kvm_arch_has_gmem_convert() to guard guest_memfd's invocation > of arch hooks related to converting memory between private and shared, as > only one half of the x86 CoCo duo needs the runtime hooks (any pre-work is > pure overhead for TDX). At this exact moment, the overhead is negligible, > but that will change when in-place conversion comes along, at which point > to-shared conversions will "need" to find all affected folios prior to > calling into arch code. In quotes because very technically that work could > be pushed to arch code, but that would bleed guest_memfd details into arch > code and would be far worse than adding yet another kvm_arch_has... hook. > > Opportunistically provide the kvm_arch_gmem_make_private() declaration, and > rely on dead-code elimination to eliminate the call to non-existent code > when CONFIG_HAVE_KVM_ARCH_GMEM_CONVERT=n. > > Reported-by: Binbin Wu <[email protected]> > Closes: > https://lore.kernel.org/all/[email protected] > Suggested-by: Ackerley Tng <[email protected]> > Signed-off-by: Sean Christopherson <[email protected]> > Signed-off-by: Ackerley Tng <[email protected]> > Reviewed-by: Fuad Tabba <[email protected]> > Reviewed-by: Binbin Wu <[email protected]> > Reviewed-by: David Hildenbrand (Arm) <[email protected]> Reviewed-by: Xiaoyao Li <[email protected]>
Re: [PATCH v13 01/44] KVM: guest_memfd: Optimize away conversion overheads via dead-code elimination
- [PATCH v13 32/44] KVM: selftests: Test conversio... Ackerley Tng via B4 Relay
- [PATCH v13 35/44] KVM: selftests: Test that shar... Ackerley Tng via B4 Relay
- [PATCH v13 34/44] KVM: selftests: Test that trun... Ackerley Tng via B4 Relay
- [PATCH v13 42/44] KVM: selftests: Set up page si... Ackerley Tng via B4 Relay
- [PATCH v13 20/44] KVM: TDX: Make source page opt... Ackerley Tng via B4 Relay
- [PATCH v13 25/44] KVM: selftests: Rename guest_m... Ackerley Tng via B4 Relay
- [PATCH v13 29/44] KVM: selftests: Test basic sin... Ackerley Tng via B4 Relay
- [PATCH v13 40/44] KVM: selftests: Provide common... Ackerley Tng via B4 Relay
- [PATCH v13 05/44] KVM: Enumerate support for PRI... Ackerley Tng via B4 Relay
- [PATCH v13 01/44] KVM: guest_memfd: Optimize awa... Ackerley Tng via B4 Relay
- Re: [PATCH v13 01/44] KVM: guest_memfd: Opt... Xiaoyao Li
- [PATCH v13 38/44] KVM: selftests: Reset shared m... Ackerley Tng via B4 Relay
- [PATCH v13 07/44] KVM: Rename kvm_mem_is_private... Ackerley Tng via B4 Relay
- [PATCH v13 16/44] KVM: guest_memfd: Call arch ma... Ackerley Tng via B4 Relay
- [PATCH v13 13/44] KVM: guest_memfd: Pass mapping... Ackerley Tng via B4 Relay
- [PATCH v13 28/44] KVM: selftests: Add helpers fo... Ackerley Tng via B4 Relay
- [PATCH v13 41/44] KVM: selftests: Make TEST_EXPE... Ackerley Tng via B4 Relay
- [PATCH v13 06/44] KVM: Rename memory attribute A... Ackerley Tng via B4 Relay
- [PATCH v13 11/44] KVM: guest_memfd: Invalidate b... Ackerley Tng via B4 Relay
- [PATCH v13 39/44] KVM: selftests: Provide functi... Ackerley Tng via B4 Relay
