[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZINGaJnNJ54+klsD@johallen-workstation.lan>
Date: Fri, 9 Jun 2023 10:34:00 -0500
From: John Allen <john.allen@....com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
Cc: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"thomas.lendacky@....com" <thomas.lendacky@....com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"Yang, Weijiang" <weijiang.yang@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"x86@...nel.org" <x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>
Subject: Re: [RFC PATCH v2 6/6] KVM: SVM: Add CET features to supported_xss
On Wed, May 24, 2023 at 05:24:23PM +0000, Edgecombe, Rick P wrote:
> On Wed, 2023-05-24 at 15:53 +0000, John Allen wrote:
> > If the CPU supports CET, add CET XSAVES feature bits to the
> > supported_xss mask.
> >
> > Signed-off-by: John Allen <john.allen@....com>
> > ---
> > v2:
> > - Remove curly braces around if statement
> > ---
> > arch/x86/kvm/svm/svm.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> > index 6afd2c44fdb6..cee496bee0a9 100644
> > --- a/arch/x86/kvm/svm/svm.c
> > +++ b/arch/x86/kvm/svm/svm.c
> > @@ -5070,6 +5070,10 @@ static __init void svm_set_cpu_caps(void)
> > boot_cpu_has(X86_FEATURE_AMD_SSBD))
> > kvm_cpu_cap_set(X86_FEATURE_VIRT_SSBD);
> >
> > + if (kvm_cpu_cap_has(X86_FEATURE_SHSTK))
> > + kvm_caps.supported_xss |= XFEATURE_MASK_CET_USER |
> > + XFEATURE_MASK_CET_KERNEL;
> > +
>
> Is setting XFEATURE_MASK_CET_KERNEL here ok? The host kernel will not
> support XFEATURE_MASK_CET_KERNEL. I guess after this there is a small
> window of time where host IA32_XSS could have non-host supported
> supervisor state.
>
> Sort of separately, how does SVM work with respect to saving and
> restoring guest supervisor CET state (I mean the CET_S stuff)?
Apart from a minor exception involving SEV-ES, we are piggybacking on
the state saving/restoring in Yang Weijiang's x86/VMX series. So by
inspection, it looks like guest supervisor support is broken as the
supervisor XSAVES state and MSRs are not included in that series. I
currently don't have a way to test this case, but I think there are
operating systems that support it. I'll work on getting a guest set up
that can actually test this and hopefully have working guest supervisor
support in the next version of the series.
Thanks,
John
>
> I'm not sure there is any problem, but just wondering how it all works.
> Thanks.
Powered by blists - more mailing lists