@@ -14,6 +14,20 @@
# define S "4"
#endif
+#define X86_CR0_PE 0x00000001
+#define X86_CR0_MP 0x00000002
+#define X86_CR0_TS 0x00000008
+#define X86_CR0_WP 0x00010000
+#define X86_CR0_PG 0x80000000
+#define X86_CR4_VMXE 0x00000001
+#define X86_CR4_TSD 0x00000004
+#define X86_CR4_DE 0x00000008
+#define X86_CR4_PSE 0x00000010
+#define X86_CR4_PAE 0x00000020
+#define X86_CR4_PCIDE 0x00020000
+
+#define X86_IA32_EFER 0xc0000080
+#define X86_EFER_LMA (1UL << 8)
struct descriptor_table_ptr {
u16 limit;
@@ -16,18 +16,6 @@
#define PTE_USER (1ull << 2)
#define PTE_ADDR (0xffffffffff000ull)
-#define X86_CR0_PE 0x00000001
-#define X86_CR0_MP 0x00000002
-#define X86_CR0_TS 0x00000008
-#define X86_CR0_WP 0x00010000
-#define X86_CR0_PG 0x80000000
-#define X86_CR4_VMXE 0x00000001
-#define X86_CR4_TSD 0x00000004
-#define X86_CR4_DE 0x00000008
-#define X86_CR4_PSE 0x00000010
-#define X86_CR4_PAE 0x00000020
-#define X86_CR4_PCIDE 0x00020000
-
void setup_vm();
void *vmalloc(unsigned long size);
@@ -7,13 +7,6 @@
#define X86_FEATURE_PCID (1 << 17)
#define X86_FEATURE_INVPCID (1 << 10)
-#define X86_CR0_PG (1 << 31)
-#define X86_CR3_PCID_MASK 0x00000fff
-#define X86_CR4_PCIDE (1 << 17)
-
-#define X86_IA32_EFER 0xc0000080
-#define X86_EFER_LMA (1UL << 8)
-
struct invpcid_desc {
unsigned long pcid : 12;
unsigned long rsv : 52;
Move them together with the inline function that read/write the control registers. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- lib/x86/processor.h | 14 ++++++++++++++ lib/x86/vm.h | 12 ------------ x86/pcid.c | 7 ------- 3 files changed, 14 insertions(+), 19 deletions(-)