From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InDTE-0003fm-7v for qemu-devel@nongnu.org; Wed, 31 Oct 2007 09:18:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InDTD-0003fM-2g for qemu-devel@nongnu.org; Wed, 31 Oct 2007 09:18:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InDTC-0003fE-Tl for qemu-devel@nongnu.org; Wed, 31 Oct 2007 09:18:54 -0400 Received: from il.qumranet.com ([82.166.9.18]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InDTC-0003Yu-5A for qemu-devel@nongnu.org; Wed, 31 Oct 2007 09:18:54 -0400 Message-ID: <47288050.3010108@qumranet.com> Date: Wed, 31 Oct 2007 15:17:04 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Update i440FX/PIIX3 emulation References: <20071024224222.GB9226@hansmi.ch> <20071031002554.GB20915@hansmi.ch> In-Reply-To: <20071031002554.GB20915@hansmi.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: igor.lvovsky@qumranet.com Michael Hanselmann wrote: > >> This does not yet remove the workaround introduced by Igor Lvovsky's >> patch. However, I'm working on that since it, despite my earlier mail, >> seems to help with my ACPI shutdown problem. >> > > So, I found the bug causing this behaviour. It turned out to be a > wrongly named variable in the ACPI DSDT from Bochs. See the patch for > Bochs below. I already sent it to the bochs-developers list[1]. > qemu/pc-bios/bios.bin needs to be rebuilt from Bochs' code, > qemu/pc-bios/bios.diff and my patch. > > The second patch below reverts the changes made by Igor Lvovsky. After > applying the patch to the BIOS, ACPI IRQs finally reach the system. > > Finding this bug took me about the free time of four weeks. However, I > learned a lot about the internals of a PC. :-) > > Thanks, > Michael > > [1] http://sourceforge.net/mailarchive/forum.php?thread_name=20071031000835.GA20915%40hansmi.ch&forum_name=bochs-developers > > --- > Index: bios/acpi-dsdt.dsl > =================================================================== > RCS file: /cvsroot/bochs/bochs/bios/acpi-dsdt.dsl,v > retrieving revision 1.1 > diff -u -p -u -p -r1.1 acpi-dsdt.dsl > --- bios/acpi-dsdt.dsl 28 Sep 2006 18:56:20 -0000 1.1 > +++ bios/acpi-dsdt.dsl 30 Oct 2007 23:52:22 -0000 > @@ -369,7 +369,7 @@ DefinitionBlock ( > Method (_STA, 0, NotSerialized) > { > Store (0x0B, Local0) > - If (And (0x80, PRQ0, Local1)) > + If (And (0x80, PRQ0, Local0)) > { > Store (0x09, Local0) > } > Can you explain this? The original code seems to return either 0xb (present, enabled, functional) or 0x9 (present, functional). The new code seems to return either 0x9 (present, functional) or 0 (if PRQ0 had its seventh bit clear). Am I reading the code incorrectly? -- Any sufficiently difficult bug is indistinguishable from a feature.