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]
Date:   Mon, 10 Apr 2023 19:25:32 +0000
From:   "Li, Xin3" <xin3.li@...el.com>
To:     "Li, Xin3" <xin3.li@...el.com>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>
CC:     "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "hpa@...or.com" <hpa@...or.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
        "Christopherson,, Sean" <seanjc@...gle.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "Shankar, Ravi V" <ravi.v.shankar@...el.com>,
        "jiangshanlai@...il.com" <jiangshanlai@...il.com>,
        "Kang, Shan" <shan.kang@...el.com>
Subject: RE: [PATCH v7 23/33] x86/fred: let ret_from_fork() jmp to
 fred_exit_user when FRED is enabled



> -----Original Message-----
> From: Li, Xin3 <xin3.li@...el.com>
> Sent: Monday, April 10, 2023 11:32 AM
> To: Hansen, Dave <dave.hansen@...el.com>; linux-kernel@...r.kernel.org;
> x86@...nel.org; kvm@...r.kernel.org
> Cc: tglx@...utronix.de; mingo@...hat.com; bp@...en8.de;
> dave.hansen@...ux.intel.com; hpa@...or.com; peterz@...radead.org;
> andrew.cooper3@...rix.com; Christopherson,, Sean <seanjc@...gle.com>;
> pbonzini@...hat.com; Shankar, Ravi V <ravi.v.shankar@...el.com>;
> jiangshanlai@...il.com; Kang, Shan <shan.kang@...el.com>
> Subject: RE: [PATCH v7 23/33] x86/fred: let ret_from_fork() jmp to fred_exit_user
> when FRED is enabled
> 
> > On 4/4/23 03:27, Xin Li wrote:
> > > --- a/arch/x86/entry/entry_64.S
> > > +++ b/arch/x86/entry/entry_64.S
> > > @@ -299,7 +299,12 @@ SYM_CODE_START_NOALIGN(ret_from_fork)
> > >  	UNWIND_HINT_REGS
> > >  	movq	%rsp, %rdi
> > >  	call	syscall_exit_to_user_mode	/* returns with IRQs disabled */
> > > +#ifdef CONFIG_X86_FRED
> > > +	ALTERNATIVE "jmp swapgs_restore_regs_and_return_to_usermode", \
> > > +		    "jmp fred_exit_user", X86_FEATURE_FRED #else
> > >  	jmp	swapgs_restore_regs_and_return_to_usermode
> > > +#endif
> >
> > Does the #ifdef really buy us anything here?
> >
> > I guess it might save a *TINY* amount of time at alternative
> > processing time.  But that doesn't really seem worth it.
> 
> You have kept saying not to use #ifdef if possible, and I tried to get if of them.
> 
> Somehow I ended up with overlooking this _unnecessary_ change, will remove.

Actually I didn't overlook it, the reason I keep the #ifdef is the symbol
"fred_exit_user" is missing otherwise, which is defined only if we have
CONFIG_X86_FRED.

Thanks!
  Xin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ