From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Adam Monsen <haircut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Windows XP crash: emulation failed but !mmio_needed?
Date: Wed, 20 Jun 2007 11:24:04 +0300 [thread overview]
Message-ID: <4678E424.4060200@qumranet.com> (raw)
In-Reply-To: <9ebd65110706192110o6253ae09l72a3e4ce58e9ca83-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]
Adam Monsen wrote:
> On 6/19/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> [...]
>
>> The virtual machine has spontaneously rebooted, then failed because
>> Windows has (legitimately) overwritten the real-mode task state segment
>> located at the end of memory. The emulation failure is for an 'out'
>> instruction, which will trap if the tss is not set up correctly.
>>
>> The emulation failure can be fixed by re-initializing the tss, or, even
>> better, moving it beyond RAM, or by fully emulating real mode, but this
>> doesn't say anything about the cause of the reboot. Is there anything
>> in the Windows event log (accessible using eventvwr.exe?)
>>
> [...]
>
> I dug through the event log a bit and did find something relevant. All
> timestamps are from Jun 17 2007 PDT.
>
> 03:08:30 - GUEST - Windows Update Agent reports security update
> installed (and I think the update agent might've been set up to
> automatically reboot; I definitely wasn't awake at 3am)
> 03:13:25 - GUEST - winlogon.exe initiated a restart
> 03:13:45 - HOST - emulation failed message
> 03:52:03 - GUEST - ACPI BIOS read error reported
> 03:52:03 - GUEST - ACPI BIOS write error reported
>
> the last log message appears at 04:14:52 (strange since I thought it
> would've died at the time "emulation failed" showed up in the host's
> log), then nothing until 08:35:46 when I manually started up the guest
> VM again.
>
>
Okay, so Windows shut itself down and hit a kvm bug. Let's hope the
emulation failure later led to the crash.
The attached patch should fix it.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
[-- Attachment #2: reinit-tss.patch --]
[-- Type: text/x-patch, Size: 620 bytes --]
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index b47ddcc..42a9163 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -31,6 +31,8 @@
MODULE_AUTHOR("Qumranet");
MODULE_LICENSE("GPL");
+static int init_rmode_tss(struct kvm *kvm);
+
static DEFINE_PER_CPU(struct vmcs *, vmxarea);
static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
@@ -951,6 +953,8 @@ static void enter_rmode(struct kvm_vcpu *vcpu)
fix_rmode_seg(VCPU_SREG_DS, &vcpu->rmode.ds);
fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs);
fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs);
+
+ init_rmode_tss(vcpu->kvm);
}
#ifdef CONFIG_X86_64
[-- Attachment #3: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
prev parent reply other threads:[~2007-06-20 8:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-17 21:32 Windows XP crash: emulation failed but !mmio_needed? Adam Monsen
[not found] ` <9ebd65110706171432p1d1041dft3f7365145b5167f1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-06-19 8:43 ` Avi Kivity
[not found] ` <4677971C.6090108-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-06-20 4:10 ` Adam Monsen
[not found] ` <9ebd65110706192110o6253ae09l72a3e4ce58e9ca83-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-06-20 8:24 ` Avi Kivity [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4678E424.4060200@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=haircut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox