From: Chris L. <cla...@re...> - 2008-04-28 16:48:17
Attachments:
kvm-66-fix-k7-msr.patch
|
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. Tested by myself on a RHEL-4 guest, and Joerg Roedel on a Windows XP 64-bit guest. Signed-off-by: Chris Lalancette <cla...@re...> |
From: Chris L. <cla...@re...> - 2008-05-05 17:07:51
Attachments:
kvm-66-fix-k7-msr2.patch
|
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. Signed-off-by: Chris Lalancette <cla...@re...> |
From: Avi K. <av...@qu...> - 2008-05-06 11:28:29
|
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. |
From: Chris L. <cla...@re...> - 2008-05-01 14:23:32
|
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. > > Tested by myself on a RHEL-4 guest, and Joerg Roedel on a Windows XP 64-bit guest. Avi, Do you mind applying this patch for me (unless you see something wrong with it, of course)? Thanks, Chris Lalancette |
From: Avi K. <av...@qu...> - 2008-05-02 10:00:24
|
Chris Lalancette wrote: > 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. >> >> Tested by myself on a RHEL-4 guest, and Joerg Roedel on a Windows XP 64-bit guest. >> > > Avi, > Do you mind applying this patch for me (unless you see something wrong with > it, of course)? > > Sorry, was behind on my email. Please add a ratelimited printk() if nonzero data is written, so that we know that the guest is using partially virtualized features. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. |