From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtwYu-0004eY-KI for qemu-devel@nongnu.org; Wed, 07 May 2008 23:12:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtwYt-0004eM-4i for qemu-devel@nongnu.org; Wed, 07 May 2008 23:12:51 -0400 Received: from [199.232.76.173] (port=39445 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtwYs-0004eJ-Vv for qemu-devel@nongnu.org; Wed, 07 May 2008 23:12:51 -0400 Received: from mx1.redhat.com ([66.187.233.31]:46730) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JtwYs-0001UK-NV for qemu-devel@nongnu.org; Wed, 07 May 2008 23:12:50 -0400 Date: Thu, 8 May 2008 00:13:15 -0300 From: Marcelo Tosatti Subject: Re: [Qemu-devel] Re: LSI: avoid infinite loops Message-ID: <20080508031315.GA29572@dmt> References: <20080507230206.GB28197@dmt> <20080507234239.GA28545@dmt> <200805080139.39137.paul@codesourcery.com> <200805080152.11677.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805080152.11677.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Alberto =?iso-8859-1?Q?Trevi=F1o?= , qemu-devel@nongnu.org On Thu, May 08, 2008 at 01:52:11AM +0100, Paul Brook wrote: > On Thursday 08 May 2008, Paul Brook wrote: > > On Thursday 08 May 2008, Marcelo Tosatti wrote: > > > On Thu, May 08, 2008 at 12:21:54AM +0100, Paul Brook wrote: > > > > On Thursday 08 May 2008, Marcelo Tosatti wrote: > > > > > The Windows driver has SCRIPTS code which busy loops on main memory. > > > > > So give the CPU's a chance to run if that happens. > > > > > > > > I'm kinda surprised this works. What causes the scripts engine to be > > > > restarted? > > > > > > LSI_ISTAT0_SIGP. > > > > In that case my surprise continues, and this is looking like an > > unbelievably horrid hack. > > > > By my reading you're making LSI_ISTAT0_SIGP effect whatever instruction > > happens to be executing when we stall. You get doubly lucky because (a) the > > guest OS decides to bang on SIGP, even though it doesn't need to. And (b) > > the last instruction executed happens to have set dnad to a value that > > "works". I'm guessing you always happen to stop execution on the > > conditional jump instruction and taking that jump doesn't cause any bad > > effects, right? > > Oh, I'd also be worried what happens if an async IO operation completes at > this point. lsi_command_complete is liable to trample all over your state. So what do you suggest as a proper fix?