Adam Monsen wrote:
> On 6/19/07, Avi Kivity <[EMAIL PROTECTED]> 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.

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
-------------------------------------------------------------------------
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/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to