$(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)
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)
{
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 */