diff options
author | Chris Lalancette <clalance@redhat.com> | 2008-06-20 03:51:30 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-07-20 05:42:36 -0400 |
commit | efa67e0d1f51842393606034051d805ab9948abd (patch) | |
tree | 9808aec9287308eef34ecce2a5a179cae776755d /arch/x86/kvm/vmx.c | |
parent | 65267ea1b3e768dc54b63cd7fad520d89c27d350 (diff) |
KVM: VMX: Fake emulate Intel perfctr MSRs
Older linux guests (in this case, 2.6.9) can attempt to
access the performance counter MSRs without a fixup section, and injecting
a GPF kills the guest. Work around by allowing the guest to write those MSRs.
Tested by me on RHEL-4 i386 and x86_64 guests, as well as F-9 guests.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6a3a4038f3b9..d493a97e7887 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -921,6 +921,18 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) | |||
921 | case MSR_IA32_TIME_STAMP_COUNTER: | 921 | case MSR_IA32_TIME_STAMP_COUNTER: |
922 | guest_write_tsc(data); | 922 | guest_write_tsc(data); |
923 | break; | 923 | break; |
924 | case MSR_P6_PERFCTR0: | ||
925 | case MSR_P6_PERFCTR1: | ||
926 | case MSR_P6_EVNTSEL0: | ||
927 | case MSR_P6_EVNTSEL1: | ||
928 | /* | ||
929 | * Just discard all writes to the performance counters; this | ||
930 | * should keep both older linux and windows 64-bit guests | ||
931 | * happy | ||
932 | */ | ||
933 | pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", msr_index, data); | ||
934 | |||
935 | break; | ||
924 | default: | 936 | default: |
925 | vmx_load_host_state(vmx); | 937 | vmx_load_host_state(vmx); |
926 | msr = find_msr_entry(vmx, msr_index); | 938 | msr = find_msr_entry(vmx, msr_index); |