lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8a392a10-9367-31ee-1a63-bc57a40ab82d@amd.com>
Date:   Mon, 4 Jan 2021 12:37:13 -0600
From:   Babu Moger <babu.moger@....com>
To:     Sean Christopherson <seanjc@...gle.com>,
        Borislav Petkov <bp@...en8.de>
Cc:     "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "fenghua.yu@...el.com" <fenghua.yu@...el.com>,
        "tony.luck@...el.com" <tony.luck@...el.com>,
        "wanpengli@...cent.com" <wanpengli@...cent.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "Lendacky, Thomas" <Thomas.Lendacky@....com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "joro@...tes.org" <joro@...tes.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "kyung.min.park@...el.com" <kyung.min.park@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "krish.sadhukhan@...cle.com" <krish.sadhukhan@...cle.com>,
        "hpa@...or.com" <hpa@...or.com>,
        "mgross@...ux.intel.com" <mgross@...ux.intel.com>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "Phillips, Kim" <kim.phillips@....com>,
        "Huang2, Wei" <Wei.Huang2@....com>,
        "jmattson@...gle.com" <jmattson@...gle.com>
Subject: RE: [PATCH v2 2/2] KVM: SVM: Add support for Virtual SPEC_CTRL



> -----Original Message-----
> From: Sean Christopherson <seanjc@...gle.com>
> Sent: Wednesday, December 30, 2020 10:08 AM
> To: Borislav Petkov <bp@...en8.de>
> Cc: Moger, Babu <Babu.Moger@....com>; pbonzini@...hat.com;
> tglx@...utronix.de; mingo@...hat.com; fenghua.yu@...el.com;
> tony.luck@...el.com; wanpengli@...cent.com; kvm@...r.kernel.org;
> Lendacky, Thomas <Thomas.Lendacky@....com>; peterz@...radead.org;
> joro@...tes.org; x86@...nel.org; kyung.min.park@...el.com; linux-
> kernel@...r.kernel.org; krish.sadhukhan@...cle.com; hpa@...or.com;
> mgross@...ux.intel.com; vkuznets@...hat.com; Phillips, Kim
> <kim.phillips@....com>; Huang2, Wei <Wei.Huang2@....com>;
> jmattson@...gle.com
> Subject: Re: [PATCH v2 2/2] KVM: SVM: Add support for Virtual SPEC_CTRL
> 
> On Wed, Dec 30, 2020, Borislav Petkov wrote:
> > On Tue, Dec 22, 2020 at 04:31:55PM -0600, Babu Moger wrote:
> > > @@ -2549,7 +2559,10 @@ static int svm_get_msr(struct kvm_vcpu *vcpu,
> struct msr_data *msr_info)
> > >  		    !guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD))
> > >  			return 1;
> > >
> > > -		msr_info->data = svm->spec_ctrl;
> > > +		if (static_cpu_has(X86_FEATURE_V_SPEC_CTRL))
> > > +			msr_info->data = svm->vmcb->save.spec_ctrl;
> > > +		else
> > > +			msr_info->data = svm->spec_ctrl;
> > >  		break;
> > >  	case MSR_AMD64_VIRT_SPEC_CTRL:
> > >  		if (!msr_info->host_initiated &&
> > > @@ -2640,6 +2653,8 @@ static int svm_set_msr(struct kvm_vcpu *vcpu,
> struct msr_data *msr)
> > >  			return 1;
> > >
> > >  		svm->spec_ctrl = data;
> > > +		if (static_cpu_has(X86_FEATURE_V_SPEC_CTRL))
> > > +			svm->vmcb->save.spec_ctrl = data;
> > >  		if (!data)
> > >  			break;
> > >
> >
> > Are the get/set_msr() accessors such a fast path that they need
> > static_cpu_has() ?
> 
> Nope, they can definitely use boot_cpu_has().

With Tom's latest comment, this change may not be required.
I will remove these changes.
Thanks
Babu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ