diff options
author | Zhang Xiantao <xiantao.zhang@intel.com> | 2007-11-19 01:33:37 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:05 -0500 |
commit | cd6e8f87efb74d91100d84894021dd12fea1a8a5 (patch) | |
tree | bc3eb01fb24a398c721632496243af141a709aa3 | |
parent | 56c6d28a9afdca0d48dd618276e055f19c0306bb (diff) |
KVM: Portability: Move some macro definitions from kvm.h to x86.h
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | drivers/kvm/kvm.h | 33 | ||||
-rw-r--r-- | drivers/kvm/x86.h | 33 |
2 files changed, 33 insertions, 33 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index c1aa84f7ca0a..aceecf4e4f2d 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -20,24 +20,6 @@ | |||
20 | #include <linux/kvm.h> | 20 | #include <linux/kvm.h> |
21 | #include <linux/kvm_para.h> | 21 | #include <linux/kvm_para.h> |
22 | 22 | ||
23 | #define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) | ||
24 | #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD)) | ||
25 | #define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) | ||
26 | |||
27 | #define KVM_GUEST_CR0_MASK \ | ||
28 | (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE \ | ||
29 | | X86_CR0_NW | X86_CR0_CD) | ||
30 | #define KVM_VM_CR0_ALWAYS_ON \ | ||
31 | (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE | X86_CR0_TS \ | ||
32 | | X86_CR0_MP) | ||
33 | #define KVM_GUEST_CR4_MASK \ | ||
34 | (X86_CR4_VME | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE | X86_CR4_VMXE) | ||
35 | #define KVM_PMODE_VM_CR4_ALWAYS_ON (X86_CR4_PAE | X86_CR4_VMXE) | ||
36 | #define KVM_RMODE_VM_CR4_ALWAYS_ON (X86_CR4_VME | X86_CR4_PAE | X86_CR4_VMXE) | ||
37 | |||
38 | #define INVALID_PAGE (~(hpa_t)0) | ||
39 | #define UNMAPPED_GVA (~(gpa_t)0) | ||
40 | |||
41 | #define KVM_MAX_VCPUS 4 | 23 | #define KVM_MAX_VCPUS 4 |
42 | #define KVM_ALIAS_SLOTS 4 | 24 | #define KVM_ALIAS_SLOTS 4 |
43 | #define KVM_MEMORY_SLOTS 8 | 25 | #define KVM_MEMORY_SLOTS 8 |
@@ -50,21 +32,6 @@ | |||
50 | #define KVM_REFILL_PAGES 25 | 32 | #define KVM_REFILL_PAGES 25 |
51 | #define KVM_MAX_CPUID_ENTRIES 40 | 33 | #define KVM_MAX_CPUID_ENTRIES 40 |
52 | 34 | ||
53 | #define DE_VECTOR 0 | ||
54 | #define UD_VECTOR 6 | ||
55 | #define NM_VECTOR 7 | ||
56 | #define DF_VECTOR 8 | ||
57 | #define TS_VECTOR 10 | ||
58 | #define NP_VECTOR 11 | ||
59 | #define SS_VECTOR 12 | ||
60 | #define GP_VECTOR 13 | ||
61 | #define PF_VECTOR 14 | ||
62 | |||
63 | #define SELECTOR_TI_MASK (1 << 2) | ||
64 | #define SELECTOR_RPL_MASK 0x03 | ||
65 | |||
66 | #define IOPL_SHIFT 12 | ||
67 | |||
68 | #define KVM_PIO_PAGE_OFFSET 1 | 35 | #define KVM_PIO_PAGE_OFFSET 1 |
69 | 36 | ||
70 | /* | 37 | /* |
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h index 4df064100226..ec1d66940c80 100644 --- a/drivers/kvm/x86.h +++ b/drivers/kvm/x86.h | |||
@@ -19,6 +19,39 @@ | |||
19 | #include <linux/kvm.h> | 19 | #include <linux/kvm.h> |
20 | #include <linux/kvm_para.h> | 20 | #include <linux/kvm_para.h> |
21 | 21 | ||
22 | #define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) | ||
23 | #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD)) | ||
24 | #define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) | ||
25 | |||
26 | #define KVM_GUEST_CR0_MASK \ | ||
27 | (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE \ | ||
28 | | X86_CR0_NW | X86_CR0_CD) | ||
29 | #define KVM_VM_CR0_ALWAYS_ON \ | ||
30 | (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE | X86_CR0_TS \ | ||
31 | | X86_CR0_MP) | ||
32 | #define KVM_GUEST_CR4_MASK \ | ||
33 | (X86_CR4_VME | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_PGE | X86_CR4_VMXE) | ||
34 | #define KVM_PMODE_VM_CR4_ALWAYS_ON (X86_CR4_PAE | X86_CR4_VMXE) | ||
35 | #define KVM_RMODE_VM_CR4_ALWAYS_ON (X86_CR4_VME | X86_CR4_PAE | X86_CR4_VMXE) | ||
36 | |||
37 | #define INVALID_PAGE (~(hpa_t)0) | ||
38 | #define UNMAPPED_GVA (~(gpa_t)0) | ||
39 | |||
40 | #define DE_VECTOR 0 | ||
41 | #define UD_VECTOR 6 | ||
42 | #define NM_VECTOR 7 | ||
43 | #define DF_VECTOR 8 | ||
44 | #define TS_VECTOR 10 | ||
45 | #define NP_VECTOR 11 | ||
46 | #define SS_VECTOR 12 | ||
47 | #define GP_VECTOR 13 | ||
48 | #define PF_VECTOR 14 | ||
49 | |||
50 | #define SELECTOR_TI_MASK (1 << 2) | ||
51 | #define SELECTOR_RPL_MASK 0x03 | ||
52 | |||
53 | #define IOPL_SHIFT 12 | ||
54 | |||
22 | extern spinlock_t kvm_lock; | 55 | extern spinlock_t kvm_lock; |
23 | extern struct list_head vm_list; | 56 | extern struct list_head vm_list; |
24 | 57 | ||