I have found out something interesting. The attached patch, which I
think should fix the bug, is present in kvm-72 Debian sources but not in
the 2.6.26-2 kernel source. So maybe rebuilding kvm from source cures
the problem; I will test this.

m...@fujiko:/tmp$
diff /home/mud/src/debian-bug-531488/linux-source-2.6.26/arch/x86/kvm/svm.c 
/tmp/linux-source-2.6.26/arch/x86/kvm/svm.c
1316,1319d1315
<       case MSR_K7_PERFCTR0:
<       case MSR_K7_PERFCTR1:
<       case MSR_K7_PERFCTR2:
<       case MSR_K7_PERFCTR3:
1321,1323c1317,1319
<                * Just discard all writes to the performance counters; this
<                * should keep both older linux and windows 64-bit guests
<                * happy
---
>                * only support writing 0 to the performance counters for now
>                * to make Windows happy. Should be replaced by a real
>                * performance counter emulation later.
1325,1326c1321,1322
<               pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 
0x%llx\n",
ecx, data);
< 
---
>               if (data != 0)
>                       goto unhandled;
1328a1325
>       unhandled:
m...@fujiko:/tmp$ 


diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 5528121..dc91b09 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1312,16 +1312,19 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
 	case MSR_K7_EVNTSEL1:
 	case MSR_K7_EVNTSEL2:
 	case MSR_K7_EVNTSEL3:
+	case MSR_K7_PERFCTR0:
+	case MSR_K7_PERFCTR1:
+	case MSR_K7_PERFCTR2:
+	case MSR_K7_PERFCTR3:
 		/*
-		 * only support writing 0 to the performance counters for now
-		 * to make Windows happy. Should be replaced by a real
-		 * performance counter emulation later.
+		 * Just discard all writes to the performance counters; this
+		 * should keep both older linux and windows 64-bit guests
+		 * happy
 		 */
-		if (data != 0)
-			goto unhandled;
+		pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", ecx, data);
+
 		break;
 	default:
-	unhandled:
 		return kvm_set_msr_common(vcpu, ecx, data);
 	}
 	return 0;

Reply via email to