From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Windows XP crash: emulation failed but !mmio_needed? Date: Wed, 20 Jun 2007 11:24:04 +0300 Message-ID: <4678E424.4060200@qumranet.com> References: <9ebd65110706171432p1d1041dft3f7365145b5167f1@mail.gmail.com> <4677971C.6090108@qumranet.com> <9ebd65110706192110o6253ae09l72a3e4ce58e9ca83@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050408000305040008020703" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Adam Monsen Return-path: In-Reply-To: <9ebd65110706192110o6253ae09l72a3e4ce58e9ca83-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------050408000305040008020703 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Adam Monsen wrote: > On 6/19/07, Avi Kivity 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. --------------050408000305040008020703 Content-Type: text/x-patch; name="reinit-tss.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="reinit-tss.patch" 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 --------------050408000305040008020703 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --------------050408000305040008020703 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------050408000305040008020703--