aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorCarlo Marcelo Arenas Belon <carenas@sajinet.com.pe>2007-12-01 07:17:11 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:16 -0500
commit2b5203ee6828e9cabab1e1fb42e53d72ab9351a6 (patch)
treecc69fb09ba9f57eff97680a0bd504c3ad7d1b62d /drivers/kvm/svm.c
parentfb56dbb31c4738a3918db81fd24da732ce3b4ae6 (diff)
KVM: SVM: Remove KVM specific defines for MSR_EFER
This patch removes the KVM specific defines for MSR_EFER that were being used in the svm support file and migrates all references to use instead the ones from the kernel headers that are used everywhere else and that have the same values. Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index fb3721d88dbf..c75c6b65b651 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -42,9 +42,6 @@ MODULE_LICENSE("GPL");
42#define SEG_TYPE_LDT 2 42#define SEG_TYPE_LDT 2
43#define SEG_TYPE_BUSY_TSS16 3 43#define SEG_TYPE_BUSY_TSS16 3
44 44
45#define KVM_EFER_LMA (1 << 10)
46#define KVM_EFER_LME (1 << 8)
47
48#define SVM_FEATURE_NPT (1 << 0) 45#define SVM_FEATURE_NPT (1 << 0)
49#define SVM_FEATURE_LBRV (1 << 1) 46#define SVM_FEATURE_LBRV (1 << 1)
50#define SVM_DEATURE_SVML (1 << 2) 47#define SVM_DEATURE_SVML (1 << 2)
@@ -184,8 +181,8 @@ static inline void flush_guest_tlb(struct kvm_vcpu *vcpu)
184 181
185static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer) 182static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
186{ 183{
187 if (!(efer & KVM_EFER_LMA)) 184 if (!(efer & EFER_LMA))
188 efer &= ~KVM_EFER_LME; 185 efer &= ~EFER_LME;
189 186
190 to_svm(vcpu)->vmcb->save.efer = efer | MSR_EFER_SVME_MASK; 187 to_svm(vcpu)->vmcb->save.efer = efer | MSR_EFER_SVME_MASK;
191 vcpu->shadow_efer = efer; 188 vcpu->shadow_efer = efer;
@@ -777,15 +774,15 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
777 struct vcpu_svm *svm = to_svm(vcpu); 774 struct vcpu_svm *svm = to_svm(vcpu);
778 775
779#ifdef CONFIG_X86_64 776#ifdef CONFIG_X86_64
780 if (vcpu->shadow_efer & KVM_EFER_LME) { 777 if (vcpu->shadow_efer & EFER_LME) {
781 if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) { 778 if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) {
782 vcpu->shadow_efer |= KVM_EFER_LMA; 779 vcpu->shadow_efer |= EFER_LMA;
783 svm->vmcb->save.efer |= KVM_EFER_LMA | KVM_EFER_LME; 780 svm->vmcb->save.efer |= EFER_LMA | EFER_LME;
784 } 781 }
785 782
786 if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) { 783 if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) {
787 vcpu->shadow_efer &= ~KVM_EFER_LMA; 784 vcpu->shadow_efer &= ~EFER_LMA;
788 svm->vmcb->save.efer &= ~(KVM_EFER_LMA | KVM_EFER_LME); 785 svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME);
789 } 786 }
790 } 787 }
791#endif 788#endif