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]
Date:	Fri, 29 Jan 2016 07:56:52 -0700
From:	Toshi Kani <toshi.kani@....com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	tglx@...utronix.de, mingo@...hat.com, hpa@...or.com, bp@...e.de,
	dan.j.williams@...el.com, ross.zwisler@...ux.intel.com,
	vishal.l.verma@...el.com, micah.parrish@....com,
	brian.boylston@....com, x86@...nel.org, linux-nvdimm@...ts.01.org,
	linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...nel.org>,
	Denys Vlasenko <dvlasenk@...hat.com>
Subject: Re: [PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy

On Fri, 2016-01-29 at 09:27 +0100, Ingo Molnar wrote:
> * Toshi Kani <toshi.kani@....com> wrote:
 :
> > ---
> >  arch/x86/lib/copy_user_64.S |   44 ++++++++++++++++++++++++++++++++---
> > --------
> >  1 file changed, 33 insertions(+), 11 deletions(-)
> > 
> > diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
> > index 982ce34..84b5578 100644
> > --- a/arch/x86/lib/copy_user_64.S
> > +++ b/arch/x86/lib/copy_user_64.S
> > @@ -232,12 +232,17 @@ ENDPROC(copy_user_enhanced_fast_string)
> >  
> >  /*
> >   * copy_user_nocache - Uncached memory copy with exception handling
> > - * This will force destination/source out of cache for more
> > performance.
> > + * This will force destination out of cache for more performance.
> > + *
> > + * Note: Cached memory copy is used when destination or size is not
> > + * naturally aligned. That is:
> > + *  - Require 8-byte alignment when size is 8 bytes or larger.
> > + *  - Require 4-byte alignment when size is 4 bytes.
> >   */
> >  ENTRY(__copy_user_nocache)
 :
> So at minimum this patch needs to add quite a few comments to explain the
> alignment dependent control flow.
> 
> Assembly code is hard enough to read as-is. Adding 20 more lines with 
> zero in-line comments is a mistake.
> 
> Btw., while at it, please add comments for the control flow of the whole 
> function.  Above a certain complexity that is a must for assembly
> functions.

Agreed.  I will add comments for the whole function.

Thanks,
-Toshi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ