[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190310133528.GA24796@local-michael-cet-test.sh.intel.com>
Date: Sun, 10 Mar 2019 21:35:29 +0800
From: Yang Weijiang <weijiang.yang@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Sean Christopherson <sean.j.christopherson@...el.com>,
rkrcmar@...hat.com, jmattson@...gle.com,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org, mst@...hat.com,
yu-cheng.yu@...el.com, Zhang Yi Z <yi.z.zhang@...ux.intel.com>
Subject: Re: [PATCH v3 7/8] KVM:X86: Add XSS bit 11 and 12 support for CET
xsaves/xrstors.
On Sun, Mar 10, 2019 at 08:20:30PM +0800, Yang Weijiang wrote:
> On Fri, Mar 08, 2019 at 12:32:04PM +0100, Paolo Bonzini wrote:
> > On 28/02/19 09:44, Yang Weijiang wrote:
> > >>> if (!vmx_xsaves_supported())
> > >>> return 1;
> > >>> +
> > >>> /*
> > >>> - * The only supported bit as of Skylake is bit 8, but
> > >>> - * it is not supported on KVM.
> > >>> + * Check bits being set are supported in KVM.
> > >> I'd drop the comment altogether, it's pretty obvious from the code that
> > >> were checking which bits are supported.
> > > you won't see these redundancies in next version ;)
> > >>> */
> > >>> - if (data != 0)
> > >>> + if (data & ~kvm_supported_xss())
> > >>> return 1;
> >
> > You should instead check this against CPUID[0xD, 1].EDX:ECX. If CET is
> > disabled in CPUID, the guest should not be able to set it in MSR_IA32_CSS.
> >
> > Paolo
> Thanks, OK, will change it.
Hi, Paolo,
How about change kvm_supported_xss() as below so that CPUID[0xd,1] check
is implied in host_xss contents, vmx_supported_xss() now just returns host_xss
in vmx.c. The purpose of this change is to make XSS data check
common for other XSS based features.
+u64 kvm_supported_xss(void)
+{
+ return KVM_SUPPORTED_XSS & kvm_x86_ops->vmx_supported_xss();
+}
+
Powered by blists - more mailing lists