From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jes Sorensen Subject: Re: [PATCH] Write to read-only msr MSR_IA32_PERF_STATUS is harmless, ignore it! Date: Tue, 31 Aug 2010 19:04:23 +0200 Message-ID: <4C7D3617.5060804@redhat.com> References: <1283257029-24102-1-git-send-email-Jes.Sorensen@redhat.com> <4C7D2DA6.40105@redhat.com> <4C7D2EDE.7020708@redhat.com> <4C7D3166.30702@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39544 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753791Ab0HaREZ (ORCPT ); Tue, 31 Aug 2010 13:04:25 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7VH4PV0004977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 31 Aug 2010 13:04:25 -0400 In-Reply-To: <4C7D3166.30702@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/31/10 18:44, Avi Kivity wrote: > On 08/31/2010 07:33 PM, Jes Sorensen wrote: >> On 08/31/10 18:28, Avi Kivity wrote: >>> On 08/31/2010 03:17 PM, Jes.Sorensen@redhat.com wrote: >>>> From: Jes Sorensen >>>> >>>> We regularly see bug reports over this one, however it is a write to >>>> a read-only register which some operating systems (including Linux) >>>> tend to write to once in a while. >>>> >>>> Ignore the writes since they do no harm. >>>> >>> Does Linux write it with wrmsr_safe()? If not, I don't see how it >>> works. If it does, then we shouldn't ignore the write, instead issue >>> the #GP as usual, but be silent about it. >> To be honest, I am having a hard time determining where the write >> happens. I looked at this with Gleb and the rip obtained by >> kvm_read_rip(vcpu) in the code doesn't indicate anything that resembles >> a wrmsr(). >> >> It was either a >> 560 outb(0xfe, 0x64); /* pulse reset low */ >> or >> 49 asm volatile("sti; hlt": : :"memory"); >> >> which makes no sense to me, > > Just grep for the msr name in a guest kernel source that's known to > trigger the message. Been there, done that! This happens with an F13 kernel during reboot. Ran the search on the expanded 2.6.32.8-149 tree and found no reference to anything trying to write it, except for KVM backing up the flag, but that shouldn't happen in the guest. >> but given it's x86, I am not sure if it >> could have come from the BIOS or something during reboot? > > The bios is the same for all kernels (and is unlikely to mess with > performance counter msrs anyway). I was fooled by this too, it's not a performance counter MSR, it's a CPU frequency scaling MSR. Cheers, Jes