diff options
author | Avi Kivity <avi@qumranet.com> | 2006-12-30 03:49:48 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-30 21:56:44 +0300 |
commit | 3bab1f5dda3443043cc8fe68c5ae75530339f28f (patch) | |
tree | d1b675e8f5328094c1a3d651da5e7563ad692252 /drivers/kvm/svm.c | |
parent | 671d6564796e0c90398aab30f89b5e48fc5a3fbe (diff) | |
download | linux-3bab1f5dda3443043cc8fe68c5ae75530339f28f.tar.xz |
[PATCH] KVM: Move common msr handling to arch independent code
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 6cd97c69ab3b..fa0428735717 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -1068,25 +1068,6 @@ static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_ru static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) { switch (ecx) { - case 0xc0010010: /* SYSCFG */ - case 0xc0010015: /* HWCR */ - case MSR_IA32_PLATFORM_ID: - case MSR_IA32_P5_MC_ADDR: - case MSR_IA32_P5_MC_TYPE: - case MSR_IA32_MC0_CTL: - case MSR_IA32_MCG_STATUS: - case MSR_IA32_MCG_CAP: - case MSR_IA32_MC0_MISC: - case MSR_IA32_MC0_MISC+4: - case MSR_IA32_MC0_MISC+8: - case MSR_IA32_MC0_MISC+12: - case MSR_IA32_MC0_MISC+16: - case MSR_IA32_UCODE_REV: - /* MTRR registers */ - case 0xfe: - case 0x200 ... 0x2ff: - *data = 0; - break; case MSR_IA32_TIME_STAMP_COUNTER: { u64 tsc; @@ -1094,12 +1075,6 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) *data = vcpu->svm->vmcb->control.tsc_offset + tsc; break; } - case MSR_EFER: - *data = vcpu->shadow_efer; - break; - case MSR_IA32_APICBASE: - *data = vcpu->apic_base; - break; case MSR_K6_STAR: *data = vcpu->svm->vmcb->save.star; break; @@ -1127,8 +1102,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) *data = vcpu->svm->vmcb->save.sysenter_esp; break; default: - printk(KERN_ERR "kvm: unhandled rdmsr: 0x%x\n", ecx); - return 1; + return kvm_get_msr_common(vcpu, ecx, data); } return 0; } @@ -1152,15 +1126,6 @@ static int rdmsr_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) { switch (ecx) { -#ifdef CONFIG_X86_64 - case MSR_EFER: - set_efer(vcpu, data); - break; -#endif - case MSR_IA32_MC0_STATUS: - printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" - , __FUNCTION__, data); - break; case MSR_IA32_TIME_STAMP_COUNTER: { u64 tsc; @@ -1168,13 +1133,6 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) vcpu->svm->vmcb->control.tsc_offset = data - tsc; break; } - case MSR_IA32_UCODE_REV: - case MSR_IA32_UCODE_WRITE: - case 0x200 ... 0x2ff: /* MTRRs */ - break; - case MSR_IA32_APICBASE: - vcpu->apic_base = data; - break; case MSR_K6_STAR: vcpu->svm->vmcb->save.star = data; break; @@ -1202,8 +1160,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) vcpu->svm->vmcb->save.sysenter_esp = data; break; default: - printk(KERN_ERR "kvm: unhandled wrmsr: %x\n", ecx); - return 1; + return kvm_set_msr_common(vcpu, ecx, data); } return 0; } |