diff options
author | Alexander Graf <agraf@suse.de> | 2008-11-25 14:17:02 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:02:46 -0400 |
commit | 9962d032bbff0268f22068787831405f8468c8b4 (patch) | |
tree | 3a9cd94334d419097923c5c4140770c17aa06cc8 /arch/x86/kvm/svm.c | |
parent | f0b85051d0f0891378a83db22c0786f1d756fbff (diff) |
KVM: SVM: Move EFER and MSR constants to generic x86 code
MSR_EFER_SVME_MASK, MSR_VM_CR and MSR_VM_HSAVE_PA are set in KVM
specific headers. Linux does have nice header files to collect
EFER bits and MSR IDs, so IMHO we should put them there.
While at it, I also changed the naming scheme to match that
of the other defines.
(introduced in v6)
Acked-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 33407d95761f..e4eb3fd91b90 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -198,7 +198,7 @@ static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer) | |||
198 | if (!npt_enabled && !(efer & EFER_LMA)) | 198 | if (!npt_enabled && !(efer & EFER_LMA)) |
199 | efer &= ~EFER_LME; | 199 | efer &= ~EFER_LME; |
200 | 200 | ||
201 | to_svm(vcpu)->vmcb->save.efer = efer | MSR_EFER_SVME_MASK; | 201 | to_svm(vcpu)->vmcb->save.efer = efer | EFER_SVME; |
202 | vcpu->arch.shadow_efer = efer; | 202 | vcpu->arch.shadow_efer = efer; |
203 | } | 203 | } |
204 | 204 | ||
@@ -292,7 +292,7 @@ static void svm_hardware_enable(void *garbage) | |||
292 | svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); | 292 | svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); |
293 | 293 | ||
294 | rdmsrl(MSR_EFER, efer); | 294 | rdmsrl(MSR_EFER, efer); |
295 | wrmsrl(MSR_EFER, efer | MSR_EFER_SVME_MASK); | 295 | wrmsrl(MSR_EFER, efer | EFER_SVME); |
296 | 296 | ||
297 | wrmsrl(MSR_VM_HSAVE_PA, | 297 | wrmsrl(MSR_VM_HSAVE_PA, |
298 | page_to_pfn(svm_data->save_area) << PAGE_SHIFT); | 298 | page_to_pfn(svm_data->save_area) << PAGE_SHIFT); |
@@ -559,7 +559,7 @@ static void init_vmcb(struct vcpu_svm *svm) | |||
559 | init_sys_seg(&save->ldtr, SEG_TYPE_LDT); | 559 | init_sys_seg(&save->ldtr, SEG_TYPE_LDT); |
560 | init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); | 560 | init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); |
561 | 561 | ||
562 | save->efer = MSR_EFER_SVME_MASK; | 562 | save->efer = EFER_SVME; |
563 | save->dr6 = 0xffff0ff0; | 563 | save->dr6 = 0xffff0ff0; |
564 | save->dr7 = 0x400; | 564 | save->dr7 = 0x400; |
565 | save->rflags = 2; | 565 | save->rflags = 2; |