Skip to contentSkip to conversation

x86_64: clobber flags in clear_page()

PATCH In review Alexey Dobriyan 3 participants 3 messages Jan 13, 2018 – Feb 13, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64: clobber flags in clear_page()

All clear_page() implementations use XOR which resets flags.

Judging by allyesconfig disassembly no code is affected.

---

 arch/x86/include/asm/page_64.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/page_64.h +1 -1
@@ -47,7 +47,7 @@ static inline void clear_page(void *page)
 			   clear_page_erms, X86_FEATURE_ERMS,
 			   "=D" (page),
 			   "0" (page)
-			   : "memory", "rax", "rcx");
+			   : "cc", "memory", "rax", "rcx");
 }
 
 void copy_page(void *to, void *from);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Alexey Dobriyan

All clear_page() implementations use XOR which resets flags.

Judging by allyesconfig disassembly no code is affected.

---

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

arch/x86/include/asm/page_64.h static inline void clear_page(void *page) · line 53

Quoted 8 lines
arch/x86/include/asm/page_64.h +1 -1
@@ -47,7 +47,7 @@ static inline void clear_page(void *page)
 			   clear_page_erms, X86_FEATURE_ERMS,
 			   "=D" (page),
 			   "0" (page)
-			   : "memory", "rax", "rcx");
+			   : "cc", "memory", "rax", "rcx");
 }
 
 void copy_page(void *to, void *from);
Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
#2 lore raw

[tip:x86/asm] x86/asm: Clobber flags in clear_page()

In reply to Alexey Dobriyan
x86/asm: Clobber flags in clear_page()
Commit-ID:  1acdbf7ea8a80706561013346d281d282a3c00f9
Gitweb:     https://git.kernel.org/tip/1acdbf7ea8a80706561013346d281d282a3c00f9
Author:     Alexey Dobriyan <[email protected]>
AuthorDate: Sat, 13 Jan 2018 21:50:48 +0300
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 13 Feb 2018 17:36:49 +0100

x86/asm: Clobber flags in clear_page()

All clear_page() implementations use XOR which resets flags.

Judging by allyesconfig disassembly no code is affected.

---
 arch/x86/include/asm/page_64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/page_64.h +1 -1
index 4baa6bc..f8a85c6 100644
@@ -47,7 +47,7 @@ static inline void clear_page(void *page)
 			   clear_page_erms, X86_FEATURE_ERMS,
 			   "=D" (page),
 			   "0" (page)
-			   : "memory", "rax", "rcx");
+			   : "cc", "memory", "rax", "rcx");
 }
 
 void copy_page(void *to, void *from);