From: Paolo Bonzini Subject: Re: [PATCH v3 7/8] KVM:X86: Add XSS bit 11 and 12 support for CET xsaves/xrstors. Date: Fri, 8 Mar 2019 11:49:17 +0100 Message-ID: <8643d7bf-15dd-858e-7973-c8796d6e9a92@redhat.com> References: <20190225132716.6982-1-weijiang.yang@intel.com> <20190225132716.6982-8-weijiang.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Zhang Yi Z , Luwei Kang To: Yang Weijiang , rkrcmar@redhat.com, sean.j.christopherson@intel.com, jmattson@google.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mst@redhat.com, yu-cheng.yu@intel.com Return-path: In-Reply-To: <20190225132716.6982-8-weijiang.yang@intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 25/02/19 14:27, Yang Weijiang wrote: > For Guest XSS, right now, only bit 11(user states) and bit 12 > (supervisor states) are supported, if other bits are being set, > need to modify KVM_SUPPORTED_XSS macro to have support. > > Signed-off-by: Zhang Yi Z > Signed-off-by: Yang Weijiang > --- > arch/x86/kvm/vmx.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index d32cee9ee079..68908ed7b151 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -47,6 +47,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -4336,12 +4337,13 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) > case MSR_IA32_XSS: > 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. > */ > - if (data != 0) > + if (data & ~kvm_supported_xss()) > return 1; > + > vcpu->arch.ia32_xss = data; > if (vcpu->arch.ia32_xss != host_xss) > add_atomic_switch_msr(vmx, MSR_IA32_XSS, > Luwei, can you work with Weijiang to add XSAVES support for Processor Tracing? Paolo