From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Lalancette Subject: Re: [PATCH]: Fix MSR_K7_EVNTSEL{0,3} for SVM Date: Mon, 28 Apr 2008 10:17:37 -0400 Message-ID: <4815DC81.90005@redhat.com> References: <480F7E92.6030709@redhat.com> <48103855.70006@qumranet.com> <4810926E.3070900@redhat.com> <4810A538.1070104@qumranet.com> <481105FB.1080705@redhat.com> <4811887E.6040202@qumranet.com> <48122647.4080404@redhat.com> <20080428124609.GU6567@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060904030304090106050607" Cc: kvm-devel , Avi Kivity To: Joerg Roedel Return-path: In-Reply-To: <20080428124609.GU6567@amd.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------060904030304090106050607 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Joerg Roedel wrote: > We already discussed the emulation of the performance counter registers > in the past. The conclusion is, that we loose live migration with that > emulation because performance monitoring is implemented differently > between AMD and Intel systems. Maybe discarding _any_ writes to > the performance counter MSRs will fix the guest crash. What we should > not do is injecting GPF on zero writes to the MSRs because that will > break Windows XP 64bit installation. OK, yeah, I read some of those threads over the weekend. It is a larger problem than just this crash, and probably one to be solved later. I have attached a patch which just discards all writes, as you suggested; this allows my RHEL-4 guest to successfully boot, although obviously the NMI watchdog which it thinks it set up is not actually working. Joerg, can you test this on your 64-bit Windows XP guest to make sure it is still working? Thanks, Chris Lalancette --------------060904030304090106050607 Content-Type: text/x-patch; name="kvm-66-fix-k7-msr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kvm-66-fix-k7-msr.patch" diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 89e0be2..6130704 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1284,16 +1284,18 @@ 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; + break; default: - unhandled: return kvm_set_msr_common(vcpu, ecx, data); } return 0; --------------060904030304090106050607 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone --------------060904030304090106050607 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------060904030304090106050607--