All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Use INVPCID mnemonic in invpcid.h
@ 2020-05-08  9:22 Uros Bizjak
  2020-05-08 11:34 ` Peter Zijlstra
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Uros Bizjak @ 2020-05-08  9:22 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Uros Bizjak, H. Peter Anvin, Ingo Molnar, Thomas Gleixner

Current minimum required version of binutils is 2.23,
which supports INVPCID instruction mnemonic.

Replace the byte-wise specification of INVPCID with
this proper mnemonic.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/invpcid.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/invpcid.h b/arch/x86/include/asm/invpcid.h
index 989cfa86de85..23749bbca0ad 100644
--- a/arch/x86/include/asm/invpcid.h
+++ b/arch/x86/include/asm/invpcid.h
@@ -12,12 +12,9 @@ static inline void __invpcid(unsigned long pcid, unsigned long addr,
 	 * stale TLB entries and, especially if we're flushing global
 	 * mappings, we don't want the compiler to reorder any subsequent
 	 * memory accesses before the TLB flush.
-	 *
-	 * The hex opcode is invpcid (%ecx), %eax in 32-bit mode and
-	 * invpcid (%rcx), %rax in long mode.
 	 */
-	asm volatile (".byte 0x66, 0x0f, 0x38, 0x82, 0x01"
-		      : : "m" (desc), "a" (type), "c" (&desc) : "memory");
+	asm volatile ("invpcid %1, %0"
+		      : : "r" (type), "m" (desc) : "memory");
 }
 
 #define INVPCID_TYPE_INDIV_ADDR		0
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-12 16:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  9:22 [PATCH] x86: Use INVPCID mnemonic in invpcid.h Uros Bizjak
2020-05-08 11:34 ` Peter Zijlstra
2020-05-08 17:32 ` H. Peter Anvin
2020-05-09 11:33 ` Borislav Petkov
2020-05-12 14:10 ` [tip: x86/cpu] x86/cpu: " tip-bot2 for Uros Bizjak
2020-05-12 14:26   ` Uros Bizjak
2020-05-12 15:15     ` Borislav Petkov
2020-05-12 15:54       ` Uros Bizjak
2020-05-12 16:28         ` Borislav Petkov

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.