diff mbox series

[4/6] x86: move INVPCID_TYPE_* to x86-defns.h

Message ID 630dddd7-3467-9204-c9da-3b776dade6a8@suse.com (mailing list archive)
State Superseded
Headers show
Series x86emul: further work | expand

Commit Message

Jan Beulich July 1, 2019, 11:57 a.m. UTC
This way the insn emulator can then too use the #define-s.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: New.

Comments

Paul Durrant July 2, 2019, 10:49 a.m. UTC | #1
> -----Original Message-----
> From: Jan Beulich <JBeulich@suse.com>
> Sent: 01 July 2019 12:57
> To: xen-devel@lists.xenproject.org
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; Paul Durrant <Paul.Durrant@citrix.com>; Roger Pau Monne
> <roger.pau@citrix.com>; Wei Liu <wl@xen.org>
> Subject: [PATCH 4/6] 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 <jbeulich@suse.com>

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Andrew Cooper Aug. 27, 2019, 2:57 p.m. UTC | #2
On 01/07/2019 12:57, Jan Beulich wrote:
> --- 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

I'd personally take the opportunity to remove the TYPE infix, as it
isn't terribly useful.

Preferably with this done, Reviewed-by: Andrew Cooper
<andrew.cooper3@citrix.com>
diff mbox series

Patch

--- 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__ */