From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH]: Fake MSR_K7 performance counters Date: Tue, 06 May 2008 14:28:29 +0300 Message-ID: <482040DD.8000808@qumranet.com> References: <481F3E4C.2050300@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Chris Lalancette Return-path: In-Reply-To: <481F3E4C.2050300@redhat.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 Chris Lalancette wrote: > Attached is a patch that fixes a guest crash when booting older Linux kernels. > The problem stems from the fact that we are currently emulating > MSR_K7_EVNTSEL[0-3], but not emulating MSR_K7_PERFCTR[0-3]. Because of this, > setup_k7_watchdog() in the Linux kernel receives a GPF when it attempts to write > into MSR_K7_PERFCTR, which causes an OOPs. > > The patch fixes it by just "fake" emulating the appropriate MSRs, throwing away > the data in the process. This causes the NMI watchdog to not actually work, but > it's not such a big deal in a virtualized environment. > > When we get a write to one of these counters, we printk_ratelimit() a warning. > I decided to print it out for all writes, even if the data is 0; it doesn't seem > to make sense to me to special case when data == 0. > > Tested by myself on a RHEL-4 guest, and Joerg Roedel on a Windows XP 64-bit guest. > Applied, thanks. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- 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