On Thu, Aug 13, 2026, Ackerley Tng wrote: > Sean Christopherson <[email protected]> writes: > > That's why I think it's worth analyzing the cost: if it's in the > > noise, leave it alone. If it's meaningful, figure out a not-too-gross way > > to skip > > the entire thing if kvm_arch_gmem_make_shared() is a glorified nop in the > > end. > > Is noise defined relative to the entire conversion process? Would this > benchmark look like > > 1. Convert 4G to shared on TDX with CONFIG_AMD_SEV defined > 2. Convert 4G to shared on TDX without CONFIG_AMD_SEV defined > > and then compare the difference in time taken?
That'd work, though I was envisioning something even simpler: use rdtsc() to count the cycles it takes to iterate over various ranges of memory. Do whatever is easiest for you though.
