Re: [PATCH v4 4/5] KVM: SVM: Add MSR_IA32_XSS to the GHCB for hypervisor kernel

John Allen
2025-09-11T15:24:02Z

On Wed, Sep 10, 2025 at 02:24:29PM -0700, Sean Christopherson wrote:
> On Mon, Sep 08, 2025, John Allen wrote:
> > When a guest issues a cpuid instruction for Fn0000000D_x0B_{x00,x01}, KVM will
> > be intercepting the CPUID instruction and will need to access the guest
> > MSR_IA32_XSS value. For SEV-ES, the XSS value is encrypted and needs to be
> > included in the GHCB to be visible to the hypervisor.
> >
> > Signed-off-by: John Allen <john.allen@amd.com>
> > ---
> > v2:
> > - Omit passing through XSS as this has already been properly
> > implemented in a26b7cd22546 ("KVM: SEV: Do not intercept
> > accesses to MSR_IA32_XSS for SEV-ES guests")
> > v3:
> > - Move guest kernel GHCB_ACCESSORS definition to new series.
>
> Except that broke _this_ series.
>
> arch/x86/kvm/svm/sev.c: In function ‘sev_es_sync_from_ghcb’:
> arch/x86/kvm/svm/sev.c:3293:39: error: implicit declaration of function ‘ghcb_get_xss’;
> did you mean ‘ghcb_get_rsi’? [-Wimplicit-function-declaration]
> 3293 | vcpu->arch.ia32_xss = ghcb_get_xss(ghcb);
> | ^~~~~~~~~~~~
> | ghcb_get_rsi
> AR drivers/base/built-in.a
> AR drivers/built-in.a

Apologies, that series should be considered a prerequisite for this
series. I pulled the guest kernel patch into a separate series since it
doesn't depend on the main series and we ideally would want it to be
pulled in ASAP rather than wait on the rest of the series since it
enables linux guests running on non-KVM hypervisors.

Thanks,
John