aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86.h
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-11-19 01:33:37 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:05 -0500
commitcd6e8f87efb74d91100d84894021dd12fea1a8a5 (patch)
treebc3eb01fb24a398c721632496243af141a709aa3 /drivers/kvm/x86.h
parent56c6d28a9afdca0d48dd618276e055f19c0306bb (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>
Diffstat (limited to 'drivers/kvm/x86.h')
-rw-r--r--drivers/kvm/x86.h33
1 files changed, 33 insertions, 0 deletions
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
22extern spinlock_t kvm_lock; 55extern spinlock_t kvm_lock;
23extern struct list_head vm_list; 56extern struct list_head vm_list;
24 57