Re: [PATCH v2 2/2] KVM: SVM: Re-load current, not host, TSC_AUX on #VMEXIT from SEV-ES guest

From: Sean Christopherson

Date: Tue Sep 23 2025 - 12:14:59 EST


On Tue, Sep 23, 2025, Xiaoyao Li wrote:
> On 9/20/2025 5:38 AM, Sean Christopherson wrote:
> > ---
> > arch/x86/kvm/svm/sev.c | 14 +++++++++++++-
> > arch/x86/kvm/svm/svm.c | 26 +++++++-------------------
> > arch/x86/kvm/svm/svm.h | 4 +++-
> > 3 files changed, 23 insertions(+), 21 deletions(-)
> >
> > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> > index cce48fff2e6c..95767b9d0d55 100644
> > --- a/arch/x86/kvm/svm/sev.c
> > +++ b/arch/x86/kvm/svm/sev.c
> > @@ -4664,7 +4664,9 @@ int sev_vcpu_create(struct kvm_vcpu *vcpu)
> > return 0;
> > }
> > -void sev_es_prepare_switch_to_guest(struct vcpu_svm *svm, struct sev_es_save_area *hostsa)
> > +void sev_es_prepare_switch_to_guest(struct vcpu_svm *svm,
> > + struct sev_es_save_area *hostsa,
> > + int tsc_aux_uret_slot)
>
> Passing the tsc_aux_uret_slot as paramter looks a bit ugly, how about
> externing it?

Yeah, looking at this again, I agree. I'll post a v3 (already did; forgot to
hit "send" on this earlier, /facepalm).