[PATCH kvm-unit-tests 08/18] x86: move CR0 and CR4 constants to processor.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move them together with the inline function that read/write the
control registers.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 lib/x86/processor.h | 14 ++++++++++++++
 lib/x86/vm.h        | 12 ------------
 x86/pcid.c          |  7 -------
 3 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/lib/x86/processor.h b/lib/x86/processor.h
index fabd480..9cc1112 100644
--- a/lib/x86/processor.h
+++ b/lib/x86/processor.h
@@ -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;
diff --git a/lib/x86/vm.h b/lib/x86/vm.h
index 03a9b4e..0b5b5c7 100644
--- a/lib/x86/vm.h
+++ b/lib/x86/vm.h
@@ -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);
diff --git a/x86/pcid.c b/x86/pcid.c
index 45adfd5..164e9a1 100644
--- a/x86/pcid.c
+++ b/x86/pcid.c
@@ -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;
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux