diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2007-12-11 09:36:57 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:22 -0500 |
commit | 62b9abaaf8423a3a38b938831b3b8431a6607ad8 (patch) | |
tree | 1518309462bb5d730b09f2d595f47998514fe37c | |
parent | 722f6ecbcf3e53809236b36e6dfd9042924a2d51 (diff) |
KVM: SVM: support writing 0 to K8 performance counter control registers
This lets SVM ignore writes of the value 0 to the performance counter control
registers. Thus enabling them will still fail in the guest, but a write of 0
which keeps them disabled is accepted. This is required to boot Windows
Vista 64bit.
[avi: avoid fall-thru in switch statement]
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Markus Rechberger <markus.rechberger@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | drivers/kvm/svm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 442ca818c5a9..ef21804a5c5c 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -1155,7 +1155,20 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) | |||
1155 | case MSR_IA32_SYSENTER_ESP: | 1155 | case MSR_IA32_SYSENTER_ESP: |
1156 | svm->vmcb->save.sysenter_esp = data; | 1156 | svm->vmcb->save.sysenter_esp = data; |
1157 | break; | 1157 | break; |
1158 | case MSR_K7_EVNTSEL0: | ||
1159 | case MSR_K7_EVNTSEL1: | ||
1160 | case MSR_K7_EVNTSEL2: | ||
1161 | case MSR_K7_EVNTSEL3: | ||
1162 | /* | ||
1163 | * only support writing 0 to the performance counters for now | ||
1164 | * to make Windows happy. Should be replaced by a real | ||
1165 | * performance counter emulation later. | ||
1166 | */ | ||
1167 | if (data != 0) | ||
1168 | goto unhandled; | ||
1169 | break; | ||
1158 | default: | 1170 | default: |
1171 | unhandled: | ||
1159 | return kvm_set_msr_common(vcpu, ecx, data); | 1172 | return kvm_set_msr_common(vcpu, ecx, data); |
1160 | } | 1173 | } |
1161 | return 0; | 1174 | return 0; |