Skip to contentSkip to conversation

SVM: support writing 0 to K8 performance counter control registers

PATCH Applied Joerg Roedel 2 participants 3 messages Dec 11, 2007 1 message not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SVM: support writing 0 to K8 performance counter control registers

This patch is a slightly improved version of a previously submitted patch. It lets SVM ignore writes of the value 0 to the performance counter control registers. Thus enabling them will still fail in the guest. This is required to boot Windows Vista 64bit.

---
 drivers/kvm/svm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/kvm/svm.c +11 -0
index 9f8564a..f81b871 100644
@@ -1155,6 +1155,17 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
 	case MSR_IA32_SYSENTER_ESP:
 		svm->vmcb->save.sysenter_esp = data;
 		break;
+	case MSR_K7_EVNTSEL0:
+	case MSR_K7_EVNTSEL1:
+	case MSR_K7_EVNTSEL2:
+	case MSR_K7_EVNTSEL3:
+		/*
+		 * only support writing 0 to the performance counters for now
+		 * to make Windows happy. Should be replaced by a real
+		 * performance counter emulation later.
+		 */
+		if (data == 0)
+			break;
 	default:
 		return kvm_set_msr_common(vcpu, ecx, data);
 	}
Signature · 11 lines
1.5.2.5




-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

A message that is not in the archive (sent off-list or not yet received): 11973838173230-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org

Applied
#2 lore raw
Quoted 6 lines · Joerg Roedel

This patch is a slightly improved version of a previously submitted patch. It lets SVM ignore writes of the value 0 to the performance counter control registers. Thus enabling them will still fail in the guest. This is required to boot Windows Vista 64bit.

Applied, thanks.

Signature · 9 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
#3 lore raw
In reply to a message not in the archive
Quoted 24 lines · Joerg Roedel

This patch is a slightly improved version of a previously submitted patch. It lets SVM ignore writes of the value 0 to the performance counter control registers. Thus enabling them will still fail in the guest. This is required to boot Windows Vista 64bit.

---
 drivers/kvm/svm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/kvm/svm.c +4 -0
index 9f8564a..f81b871 100644
@@ -1155,6 +1155,17 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
 	case MSR_IA32_SYSENTER_ESP:
 		svm->vmcb->save.sysenter_esp = data;
 		break;
+	case MSR_K7_EVNTSEL0:
+	case MSR_K7_EVNTSEL1:
+	case MSR_K7_EVNTSEL2:
+	case MSR_K7_EVNTSEL3:

drivers/kvm/svm.c static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) · line 1171

Quoted 10 lines
drivers/kvm/svm.c +7 -0
+		/*
+		 * only support writing 0 to the performance counters for now
+		 * to make Windows happy. Should be replaced by a real
+		 * performance counter emulation later.
+		 */
+		if (data == 0)
+			break;
 	default:
 		return kvm_set_msr_common(vcpu, ecx, data);
 	}

I changed the fall-thru here to something more explicit, in case someone wants to add more msrs.

Signature · 9 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php