linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, bp@suse.de
Subject: [PATCH 4/5] x86_64: clobber "cc" in inlined clear_page()
Date: Wed, 26 Apr 2017 21:34:05 +0300	[thread overview]
Message-ID: <20170426183405.GD5069@avx2> (raw)
In-Reply-To: <20170426183047.GC5069@avx2>

Both REP variants clobber flags because of "xor eax, eax" instructions.
While they can be changed to "mov eax, 0", generic version probably
can not because it has to do comparison at some point.

And it is kind of not worth it to not clobber flags anyway.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/page_64.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -46,7 +46,7 @@ static inline void clear_page(void *page)
 			   clear_page_rep_stosb, X86_FEATURE_ERMS,
 			   "=D" (page),
 			   "0" (page)
-			   : "memory", "rax", "rcx");
+			   : "cc", "memory", "rax", "rcx");
 }
 
 void copy_page_mov(void *to, void *from);

  reply	other threads:[~2017-04-26 18:34 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     ` Alexey Dobriyan [this message]
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
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=20170426183405.GD5069@avx2 \
    --to=adobriyan@gmail.com \
    --cc=bp@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).