On 5/16/25 16:28, Sean Christopherson wrote: > From: Zheyun Shen <szy0...@sjtu.edu.cn> > > On AMD CPUs without ensuring cache consistency, each memory page > reclamation in an SEV guest triggers a call to do WBNOINVD/WBINVD on all > CPUs, thereby affecting the performance of other programs on the host. > > Typically, an AMD server may have 128 cores or more, while the SEV guest > might only utilize 8 of these cores. Meanwhile, host can use qemu-affinity > to bind these 8 vCPUs to specific physical CPUs. > > Therefore, keeping a record of the physical core numbers each time a vCPU > runs can help avoid flushing the cache for all CPUs every time. > > Signed-off-by: Zheyun Shen <szy0...@sjtu.edu.cn> > Co-developed-by: Sean Christopherson <sea...@google.com> > Signed-off-by: Sean Christopherson <sea...@google.com>
Reviewed-by: Tom Lendacky <thomas.lenda...@amd.com> > --- > arch/x86/kvm/svm/sev.c | 46 +++++++++++++++++++++++++++++++++++------- > arch/x86/kvm/svm/svm.h | 1 + > 2 files changed, 40 insertions(+), 7 deletions(-) >