lkml.org 
[lkml]   [2019]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/20] x86/uaccess: Move copy_user_handle_tail into asm
On Fri, Mar 08, 2019 at 12:53:21PM -0600, Josh Poimboeuf wrote:
> On Thu, Mar 07, 2019 at 12:45:14PM +0100, Peter Zijlstra wrote:
> > /*
> > + * Try to copy last bytes and clear the rest if needed.
> > + * Since protection fault in copy_from/to_user is not a normal situation,
> > + * it is not necessary to optimize tail handling.
> > + *
> > + * Input:
> > + * rdi destination
> > + * rsi source
> > + * rdx count
> > + *
> > + * Output:
> > + * eax uncopied bytes or 0 if successful.
> > + */
> > +ALIGN;
> > +copy_user_handle_tail:
> > + movl %edx,%ecx
> > +1: rep movsb
> > +2: mov %ecx,%eax
> > + ASM_CLAC
> > + ret
> > +
> > + _ASM_EXTABLE_UA(1b, 2b)
> > +ENDPROC(copy_user_handle_tail)
>
> This is an unstructured piece of code rather than a callable function,
> END would probably be more appropriate. Or maybe it should just be a
> local label (.Lcopy_user_handle_tail) because I don't think the
> alignment and ELF symbol size are even needed.

ENDPROC makes it STT_FUNC and gets us stricter AC tests.

\
 
 \ /
  Last update: 2019-03-08 20:49    [W:0.108 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site