aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-07-17 09:19:08 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:18 -0400
commit707d92fa72b425bc919a84670c01402e81505c58 (patch)
tree9e3a55293e867e499fd625ebac45db565ff0fc38 /drivers/kvm/kvm.h
parent9a2b85c620b9779360c7726de4caeda78cac38d4 (diff)
KVM: Trivial: Use standard CR0 flags macros from asm/cpu-features.h
The kernel now has asm/cpu-features.h: use those macros instead of inventing our own. Also spell out definition of CR0_RESEVED_BITS (no code change) and fix typo. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index b629a83eb82d..7117c3b3cca7 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -19,15 +19,6 @@
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 CR0_PE_MASK (1ULL << 0)
23#define CR0_MP_MASK (1ULL << 1)
24#define CR0_TS_MASK (1ULL << 3)
25#define CR0_NE_MASK (1ULL << 5)
26#define CR0_WP_MASK (1ULL << 16)
27#define CR0_NW_MASK (1ULL << 29)
28#define CR0_CD_MASK (1ULL << 30)
29#define CR0_PG_MASK (1ULL << 31)
30
31#define CR3_WPT_MASK (1ULL << 3) 22#define CR3_WPT_MASK (1ULL << 3)
32#define CR3_PCD_MASK (1ULL << 4) 23#define CR3_PCD_MASK (1ULL << 4)
33 24
@@ -42,11 +33,11 @@
42#define CR4_VMXE_MASK (1ULL << 13) 33#define CR4_VMXE_MASK (1ULL << 13)
43 34
44#define KVM_GUEST_CR0_MASK \ 35#define KVM_GUEST_CR0_MASK \
45 (CR0_PG_MASK | CR0_PE_MASK | CR0_WP_MASK | CR0_NE_MASK \ 36 (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE \
46 | CR0_NW_MASK | CR0_CD_MASK) 37 | X86_CR0_NW | X86_CR0_CD)
47#define KVM_VM_CR0_ALWAYS_ON \ 38#define KVM_VM_CR0_ALWAYS_ON \
48 (CR0_PG_MASK | CR0_PE_MASK | CR0_WP_MASK | CR0_NE_MASK | CR0_TS_MASK \ 39 (X86_CR0_PG | X86_CR0_PE | X86_CR0_WP | X86_CR0_NE | X86_CR0_TS \
49 | CR0_MP_MASK) 40 | X86_CR0_MP)
50#define KVM_GUEST_CR4_MASK \ 41#define KVM_GUEST_CR4_MASK \
51 (CR4_PSE_MASK | CR4_PAE_MASK | CR4_PGE_MASK | CR4_VMXE_MASK | CR4_VME_MASK) 42 (CR4_PSE_MASK | CR4_PAE_MASK | CR4_PGE_MASK | CR4_VMXE_MASK | CR4_VME_MASK)
52#define KVM_PMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK) 43#define KVM_PMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK)
@@ -667,7 +658,7 @@ static inline int is_pse(struct kvm_vcpu *vcpu)
667 658
668static inline int is_paging(struct kvm_vcpu *vcpu) 659static inline int is_paging(struct kvm_vcpu *vcpu)
669{ 660{
670 return vcpu->cr0 & CR0_PG_MASK; 661 return vcpu->cr0 & X86_CR0_PG;
671} 662}
672 663
673static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot) 664static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)