From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: Questions on the VMentry failure patch Date: Mon, 14 Jul 2008 11:15:22 -0500 Message-ID: <487B7B9A.7030907@codemonkey.ws> References: <52d4a3890807070707n4e0039ccgc07aa0fa3ab28d8e@mail.gmail.com> <48722720.7050409@qumranet.com> <52d4a3890807070744i66a9db56r787eecc62081c8e8@mail.gmail.com> <48722D99.2030009@qumranet.com> <4872363F.5010103@codemonkey.ws> <52d4a3890807071752g5675558el38bded8bd475c68a@mail.gmail.com> <52d4a3890807091056j1ff4db6fo16cf364dfa8a36de@mail.gmail.com> <52d4a3890807100648n2909eda1h1aeb993ae00aaa18@mail.gmail.com> <52d4a3890807140910v2157fc14p397dd78cc949dc5b@mail.gmail.com> <487B7AF6.2060607@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mohammed Gamal , kvm@vger.kernel.org, Rik van Riel , Guillaume Thouvenin To: Avi Kivity Return-path: Received: from wx-out-0506.google.com ([66.249.82.235]:52235 "EHLO wx-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755719AbYGNQPu (ORCPT ); Mon, 14 Jul 2008 12:15:50 -0400 Received: by wx-out-0506.google.com with SMTP id h29so2358296wxd.4 for ; Mon, 14 Jul 2008 09:15:50 -0700 (PDT) In-Reply-To: <487B7AF6.2060607@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > Mohammed Gamal wrote: >> On Thu, Jul 10, 2008 at 4:48 PM, Mohammed Gamal >> wrote: >> >>>>> It's true indeed, the patch did increase the likelihood of the >>>>> problem with me (although it occurs every few runs). I modified >>>>> invalid_guest_state() to call kvm_report_emulation_failure() in all >>>>> cases and I noticed that whenever the crash happens it happens here: >>>>> >>>>> rip 6e10 66 b8 20 00 >>>>> >>>>> It's too late at night here, so I'll not lookup the opcode map now :) >>>>> . I'll further look into it later. >>>>> >>>>> >>>> Another thing, I tried -no-kvm-pit switch and it tremendously increase >>>> the likelihood of the crash to almost a 100%. >>>> >>>> >>> I updated to the latest kvm-userspace git tree, and now the failure is >>> happening at completely random instructions whether or not we are >>> using -no-kvm-pit. >>> >>> >> >> I didn't have the gfxboot source code in hand, but now that I've got >> it. It clears out that the failure always occurs in the >> switch_to_pm_20 routine. However, the failure doesn't happen at one >> particular instruction, but either doesn't happen at all or happens at >> any instruction between addresses 6e10 and 6e27. >> >> I'm suspecting it might be some kind of a race condition, although I >> don't see where in the code - kernel side to specific - that this race >> exactly might occur. Maybe the locking changes in the userspace side >> helped some underlying issue to come up to the surface just like what >> happened with FreeDOS. I'll look further into it, any >> pointers/help/suggestions are appreciated. >> > > I suspected an interrupt, which fits the scenario you describe. > Although Anthony tested this and found out interrupts were not > involved, IIRC. It was at least not occurring for me when an interrupt was being injected. That's not to say that it isn't somehow affected by interrupt injections but it doesn't appear to be the obvious interrupt occurs while doing switch_to_pm_20. Regards, Anthony Liguori