All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "the arch/x86 maintainers" <x86@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] x86_64: inline copy_page() at call site
Date: Tue, 2 May 2017 14:49:04 +0300	[thread overview]
Message-ID: <CACVxJT9u6Xj3ZLOf0mNUBTiF-AeTGR9k4hGgkH9zA0Bh9LDbBQ@mail.gmail.com> (raw)
In-Reply-To: <20170428210409.ap3bnb4i3l4gm36p@pd.tnic>

On Sat, Apr 29, 2017 at 12:04 AM, Borislav Petkov <bp@alien8.de> wrote:
> On Wed, Apr 26, 2017 at 09:28:06PM +0300, Alexey Dobriyan wrote:

>> +static __always_inline void copy_page(void *to, void *from)
>> +{
>> +     alternative_call_2(
>
> Please align at the opening brace, like clear_page() above it:

Then I'd have to split clobber list and no lines will be saved.

>         alternative_call_2(copy_page_mov,
>                            copy_page_rep_movsq, X86_FEATURE_REP_GOOD,
>                            ...
>
>
>> +             copy_page_rep_movsb, X86_FEATURE_ERMS,
>> +             ASM_OUTPUT2("=D" (to), "=S" (from)),
>> +             "0" (to), "1" (from)
>> +             : "rax", "rcx", "rdx", "r8", "r9", "r10", "r11", "cc", "memory"
>> +     );
>> +}
>>  #endif       /* !__ASSEMBLY__ */
>>
>>  #ifdef CONFIG_X86_VSYSCALL_EMULATION
>
> ...
>
>>  ENTRY(copy_page_rep_movsb)
>>       mov     $4096, %ecx
>>       rep movsb
>>       ret
>>  ENDPROC(copy_page_rep_movsb)
>> +EXPORT_SYMBOL(copy_page_rep_movsb)
>>
>> -ENTRY(copy_page_regs)
>> +ENTRY(copy_page_mov)
>
> copy_page_regs() is a better name IMO. copy_page_mov() doesn't tell me
> anything - all three use "mov". copy_page_unrolled() sounds ok too.

It says unambiguously which instruction does the actual copying.

  reply	other threads:[~2017-05-02 11:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 18:23 [PATCH 1/5] x86_64: use REP MOVSB in copy_page() Alexey Dobriyan
2017-04-26 18:28 ` [PATCH 2/5] x86_64: inline copy_page() at call site Alexey Dobriyan
2017-04-26 18:30   ` [PATCH 3/5] x86_64: rename clear_page() and copy_user() variants Alexey Dobriyan
2017-04-26 18:34     ` [PATCH 4/5] x86_64: clobber "cc" in inlined clear_page() Alexey Dobriyan
2017-04-26 18:35       ` [PATCH 5/5] x86_64: garbage collect headers in clear_page.S Alexey Dobriyan
2017-05-05 16:58     ` [PATCH 3/5] x86_64: rename clear_page() and copy_user() variants Borislav Petkov
2017-04-28 21:04   ` [PATCH 2/5] x86_64: inline copy_page() at call site Borislav Petkov
2017-05-02 11:49     ` Alexey Dobriyan [this message]
2017-05-02 11:59       ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACVxJT9u6Xj3ZLOf0mNUBTiF-AeTGR9k4hGgkH9zA0Bh9LDbBQ@mail.gmail.com \
    --to=adobriyan@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.