From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Clayton Subject: Re: qemu-kvm-1.1.0 crashing with kernel 3.5.0-rc6 Date: Sun, 29 Jul 2012 20:10:15 +0100 Message-ID: <50158A97.3050909@googlemail.com> References: <5011D123.4060101@googlemail.com> <5012719A.5080208@googlemail.com> <5012E659.7060304@googlemail.com> <50152FC8.20905@redhat.com> <50154294.9040705@googlemail.com> <50154632.7010304@redhat.com> <50155AF4.9050500@redhat.com> <5015662A.2000006@redhat.com> <501577D1.7030205@googlemail.com> <20120729175453.GA32360@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Eric Northup , kvm@vger.kernel.org, Jan Kiszka To: Gleb Natapov Return-path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:63750 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753367Ab2G2TKP (ORCPT ); Sun, 29 Jul 2012 15:10:15 -0400 Received: by eeil10 with SMTP id l10so1074361eei.19 for ; Sun, 29 Jul 2012 12:10:14 -0700 (PDT) In-Reply-To: <20120729175453.GA32360@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/29/12 18:54, Gleb Natapov wrote: > On Sun, Jul 29, 2012 at 06:50:09PM +0100, Chris Clayton wrote: >> On 07/29/12 17:34, Avi Kivity wrote: >>> On 07/29/2012 06:47 PM, Avi Kivity wrote: >>>>> What might have happened is that the movdqu instruction faulted (as it's >>>>> an fpu instruction), and on the way back from the fault, ds and es >>>>> didn't get restored correctly. >>>>> >>>>> You can test this by writing a trivial version of g_str_equal() >>>>> somewhere in the qemu source code and rebuilding it. >>>>> >>>>> >>>> >>> >from entry_32.S: >>>> >>>> .macro RESTORE_REGS pop=0 >>>> RESTORE_INT_REGS >>>> 1: popl_cfi %ds >>>> /*CFI_RESTORE ds;*/ >>>> 2: popl_cfi %es >>>> /*CFI_RESTORE es;*/ >>>> 3: popl_cfi %fs >>>> /*CFI_RESTORE fs;*/ >>>> POP_GS \pop >>>> .pushsection .fixup, "ax" >>>> 4: movl $0, (%esp) >>>> jmp 1b >>>> 5: movl $0, (%esp) >>>> jmp 2b >>>> 6: movl $0, (%esp) >>>> jmp 3b >>>> .popsection >>>> >>>> this piece of code tries to restore %ds, and if it fails, zeros it, >>>> which is consistent with the core dump. >>>> >>>> This could happen if kvm is failing to restore GDT correctly. >>>> >>> >>> Possible culprit: b2da15ac26a0c00. >>> >>> >> That commit isn't in qermu-kvm-1.1.1. >> > It is in kernel. > Sorry, so it is. With kernel 3.5.0 with b2da15ac26a0c00 reverted, I have just had 15 clean invocations of vanilla qemu-kvm-1.1.1. So that commit would seem to be the problem. >> I'm testing a build with g_str_equal implemented in kvm.c and so far >> I haven't had a crash in 6 invocations. That hasn't been possible >> with vanilla qemu-kvm-1.1.{0,1}, but I'll do a few more, just to be >> sure. >> Similarly, with my "local" implementation of g_str_equal, I've had 15 clean invocations on vanilla kernel 3.5.0. I'm more than happy to test patches to fix this regression, but it will be tomorrow before I will be able to do so. >> Thanks for your help, Avi. > > -- > Gleb. >