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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241205231320.zv737k57pfqqfu36@jpoimboe>
Date: Thu, 5 Dec 2024 15:13:20 -0800
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, amit@...nel.org,
	kvm@...r.kernel.org, amit.shah@....com, thomas.lendacky@....com,
	tglx@...utronix.de, peterz@...radead.org,
	pawan.kumar.gupta@...ux.intel.com, corbet@....net, mingo@...hat.com,
	dave.hansen@...ux.intel.com, hpa@...or.com, seanjc@...gle.com,
	pbonzini@...hat.com, daniel.sneddon@...ux.intel.com,
	kai.huang@...el.com, sandipan.das@....com,
	boris.ostrovsky@...cle.com, Babu.Moger@....com,
	david.kaplan@....com, dwmw@...zon.co.uk, andrew.cooper3@...rix.com
Subject: Re: [PATCH v2 1/2] x86/bugs: Don't fill RSB on VMEXIT with
 eIBRS+retpoline

On Sat, Nov 30, 2024 at 04:31:25PM +0100, Borislav Petkov wrote:
> On Thu, Nov 21, 2024 at 12:07:18PM -0800, Josh Poimboeuf wrote:
> > --- a/arch/x86/kernel/cpu/bugs.c
> > +++ b/arch/x86/kernel/cpu/bugs.c
> > @@ -1605,20 +1605,20 @@ static void __init spectre_v2_determine_rsb_fill_type_at_vmexit(enum spectre_v2_
> >  	case SPECTRE_V2_NONE:
> >  		return;
> >  
> > -	case SPECTRE_V2_EIBRS_LFENCE:
> >  	case SPECTRE_V2_EIBRS:
> > +	case SPECTRE_V2_EIBRS_LFENCE:
> > +	case SPECTRE_V2_EIBRS_RETPOLINE:
> >  		if (boot_cpu_has_bug(X86_BUG_EIBRS_PBRSB)) {
> > -			setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT_LITE);
> >  			pr_info("Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT\n");
> > +			setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT_LITE);
> 
> Why are you swapping those?
> 
> >  		}
> >  		return;
> >  
> > -	case SPECTRE_V2_EIBRS_RETPOLINE:
> >  	case SPECTRE_V2_RETPOLINE:
> >  	case SPECTRE_V2_LFENCE:
> >  	case SPECTRE_V2_IBRS:
> > -		setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT);
> >  		pr_info("Spectre v2 / SpectreRSB : Filling RSB on VMEXIT\n");
> > +		setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT);
> 
> Ditto?

It's more readable that way, similar to how a comment goes before code.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ