]> xenbits.xensource.com Git - xen.git/commitdiff
x86/asm: Remove HAVE_AS_INVPCID
authorDenis Mukhin <dmukhin@ford.com>
Thu, 3 Apr 2025 18:23:13 +0000 (18:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 3 Apr 2025 20:29:34 +0000 (21:29 +0100)
The new toolchain baseline knows the INVPCID instruction; no need to carry the
workaround in the code.

No functional change.

Resolves: https://gitlab.com/xen-project/xen/-/work_items/209
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/arch.mk
xen/arch/x86/include/asm/invpcid.h

index 6d2876b1a8c6bfa7732f69c9b1476e5ed42d50d3..dcc8c3c330dcc2d54845394e82167dc1539f1c33 100644 (file)
@@ -16,7 +16,6 @@ $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
-$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
index bf5c30313a831324af2204ebc33eef5d6781612b..204052f1b40df4aff7184d38184c00b853b8f377 100644 (file)
@@ -5,9 +5,6 @@
 
 extern bool use_invpcid;
 
-#define INVPCID_OPCODE ".byte 0x66, 0x0f, 0x38, 0x82\n"
-#define MODRM_ECX_01   ".byte 0x01\n"
-
 static inline void invpcid(unsigned int pcid, unsigned long addr,
                            unsigned int type)
 {
@@ -17,17 +14,10 @@ static inline void invpcid(unsigned int pcid, unsigned long addr,
         uint64_t addr;
     } desc = { .pcid = pcid, .addr = addr };
 
-    asm volatile (
-#ifdef HAVE_AS_INVPCID
-                  "invpcid %[desc], %q[type]"
-                  : /* No output */
-                  : [desc] "m" (desc), [type] "r" (type)
-#else
-                  INVPCID_OPCODE MODRM_ECX_01
-                  : /* No output */
-                  : "a" (type), "c" (&desc)
-#endif
-                  : "memory" );
+    asm volatile ( "invpcid %[desc], %q[type]"
+                   :
+                   : [desc] "m" (desc), [type] "r" (type)
+                   : "memory" );
 }
 
 /* Flush all mappings for a given PCID and addr, not including globals */