x86: move INVPCID_TYPE_* to x86-defns.h This way the insn emulator can then too use the #define-s. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant --- v2: New. --- 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 /* 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_TYPE_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_TYPE_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_TYPE_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_TYPE_ALL_NON_GLOBAL); } #endif /* _ASM_X86_INVPCID_H_ */ --- 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_TYPE_INDIV_ADDR 0 +#define X86_INVPCID_TYPE_SINGLE_CTXT 1 +#define X86_INVPCID_TYPE_ALL_INCL_GLOBAL 2 +#define X86_INVPCID_TYPE_ALL_NON_GLOBAL 3 + #endif /* __XEN_X86_DEFNS_H__ */