From: Jan Beulich Date: Fri, 30 Aug 2019 13:21:54 +0000 (+0200) Subject: x86: move INVPCID_TYPE_* to x86-defns.h X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6e2ea60524b51b1eacff38d15c49efc5e7f2c3b4;p=people%2Fiwj%2Fxen.git x86: move INVPCID_TYPE_* to x86-defns.h This way the insn emulator can then too use the #define-s. In place of the TYPE infix add an X86 prefix. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Reviewed-by: Andrew Cooper --- diff --git a/xen/include/asm-x86/invpcid.h b/xen/include/asm-x86/invpcid.h index edd8b68706..bf5c30313a 100644 --- a/xen/include/asm-x86/invpcid.h +++ b/xen/include/asm-x86/invpcid.h @@ -5,11 +5,6 @@ extern bool use_invpcid; -#define INVPCID_TYPE_INDIV_ADDR 0 -#define INVPCID_TYPE_SINGLE_CTXT 1 -#define INVPCID_TYPE_ALL_INCL_GLOBAL 2 -#define INVPCID_TYPE_ALL_NON_GLOBAL 3 - #define INVPCID_OPCODE ".byte 0x66, 0x0f, 0x38, 0x82\n" #define MODRM_ECX_01 ".byte 0x01\n" @@ -38,25 +33,25 @@ static inline void invpcid(unsigned int pcid, unsigned long addr, /* Flush all mappings for a given PCID and addr, not including globals */ static inline void invpcid_flush_one(unsigned int pcid, unsigned long addr) { - invpcid(pcid, addr, INVPCID_TYPE_INDIV_ADDR); + invpcid(pcid, addr, X86_INVPCID_INDIV_ADDR); } /* Flush all mappings for a given PCID, not including globals */ static inline void invpcid_flush_single_context(unsigned int pcid) { - invpcid(pcid, 0, INVPCID_TYPE_SINGLE_CTXT); + invpcid(pcid, 0, X86_INVPCID_SINGLE_CTXT); } /* Flush all mappings, including globals, for all PCIDs */ static inline void invpcid_flush_all(void) { - invpcid(0, 0, INVPCID_TYPE_ALL_INCL_GLOBAL); + invpcid(0, 0, X86_INVPCID_ALL_INCL_GLOBAL); } /* Flush all mappings for all PCIDs, excluding globals */ static inline void invpcid_flush_all_nonglobals(void) { - invpcid(0, 0, INVPCID_TYPE_ALL_NON_GLOBAL); + invpcid(0, 0, X86_INVPCID_ALL_NON_GLOBAL); } #endif /* _ASM_X86_INVPCID_H_ */ diff --git a/xen/include/asm-x86/x86-defns.h b/xen/include/asm-x86/x86-defns.h index 193997bd02..55c0f06ab8 100644 --- a/xen/include/asm-x86/x86-defns.h +++ b/xen/include/asm-x86/x86-defns.h @@ -108,4 +108,12 @@ */ #define X86_DR7_DEFAULT 0x00000400 /* Default %dr7 value. */ +/* + * Invalidation types for the INVPCID instruction. + */ +#define X86_INVPCID_INDIV_ADDR 0 +#define X86_INVPCID_SINGLE_CTXT 1 +#define X86_INVPCID_ALL_INCL_GLOBAL 2 +#define X86_INVPCID_ALL_NON_GLOBAL 3 + #endif /* __XEN_X86_DEFNS_H__ */