Received: from [140.186.70.92] (port=48641 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pv3Gq-0006pr-Vj for qemu-devel@nongnu.org; Thu, 03 Mar 2011 02:48:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pv3Gp-0007a5-EE for qemu-devel@nongnu.org; Thu, 03 Mar 2011 02:48:24 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:49266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pv3Go-0007ZY-Sw for qemu-devel@nongnu.org; Thu, 03 Mar 2011 02:48:23 -0500 Date: Thu, 3 Mar 2011 16:48:21 +0900 From: Isaku Yamahata Subject: Re: [Qemu-devel] Re: EFI console stopped working in Qemu 0.14.0 Message-ID: <20110303074821.GI1759@valinux.co.jp> References: <4D6EA921.60907@gmail.com> <4D6EB643.4030805@gmail.com> <20110303030353.GC1759@valinux.co.jp> <20110303030959.GD1759@valinux.co.jp> <4D6F387F.2000505@gmail.com> <20110303074634.GH1759@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110303074634.GH1759@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: vagran Cc: Tristan Gingold , qemu-devel@nongnu.org Added CC to Tristan. I doubt that he is still interested in EFI, though. On Thu, Mar 03, 2011 at 04:46:34PM +0900, Isaku Yamahata wrote: > > Seabios has the patch to address the similar issue with > the changeset of b82a1e49fc0e72fb9bf1a642d6aa707345b0f398, > which enables memory/io unconditionally. > > I suppose the EFI bios is very old so that it has the same issue. > I think the following file is the one to modify. > > efi-vfirmware.hg/edk2-sparse/EdkQemuPkg/Pei/BochsPciScan/BochsPciScan.c > > thanks, > > On Thu, Mar 03, 2011 at 08:43:11AM +0200, vagran wrote: > > I am using TianoCore EFI by Tristan Gingold which is published > > on http://wiki.qemu.org/download/efi-bios.tar.bz2. If you would try > > to load it on Qemu 0.14.0 (built either for i386 or x86_64) you will > > see nothing on VGA display or serial console. But it still will be > > able to load OS after timeout if you have proper disk image. > >> It seems your EFI BIOS doesn't enable memor, io or master bits > >> in command register. > >> > >> > >> or disableintx. > >> > > I have checked your guess and figured out that it works only > > if both memory and io bits are not cleared. So the following > > patch also works: > > diff --git a/hw/pci.c b/hw/pci.c > > index 8b76cea..bcf9b16 100644 > > --- a/hw/pci.c > > +++ b/hw/pci.c > > @@ -163,8 +163,9 @@ void pci_device_reset(PCIDevice *dev) > > pci_device_deassert_intx(dev); > > /* Clear all writeable bits */ > > pci_word_test_and_clear_mask(dev->config + PCI_COMMAND, > > - pci_get_word(dev->wmask + PCI_COMMAND) | > > - pci_get_word(dev->w1cmask + PCI_COMMAND)); > > + (pci_get_word(dev->wmask + PCI_COMMAND) | > > + pci_get_word(dev->w1cmask + > > PCI_COMMAND)) & > > + ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)); > > pci_word_test_and_clear_mask(dev->config + PCI_STATUS, > > pci_get_word(dev->wmask + PCI_STATUS) | > > pci_get_word(dev->w1cmask + PCI_STATUS)); > > > > So probably the problem is in EFI BIOS. But I was not able to find > > its source code. Anyone knows how is it built? > > > > Best regards, > > Artyom. > > > > > > Isaku Yamahata wrote: > >> On Thu, Mar 03, 2011 at 12:03:53PM +0900, Isaku Yamahata wrote: > >> > >>> Hi. Thank you for reporting. > >>> Can you elaborate on the changeset that you pointed out and > >>> your work around? > >>> > >>> Regarding to the changeset, it had the issue, but I suppose > >>> 80376c3fc2c38fdd45354e4b0eb45031f35587ed fixed it. > >>> Do you found any other issue? > >>> > >>> Regarding to your workaround, what was the problem? > >>> What EFI BIOS are you using? Tiano-core derivatives that > >>> Tristan Gingold worked on? Or other one? > >>> It seems your EFI BIOS doesn't enable memor, io or master bits > >>> in command register. > >>> > >> > >> or disableintx. > >> > >> > >>> If so, the issue is in the bios, not qemu. > >>> > >>> thanks, > >>> > >>> On Wed, Mar 02, 2011 at 11:27:31PM +0200, vagran wrote: > >>> > >>>> vagran wrote: > >>>> > >>>>> Hi, > >>>>> I have noted that Qemu VGA and serial console with EFI BIOS > >>>>> stopped working in > >>>>> 0.14.0 (and in latest development snapshot is still not working). > >>>>> Everything was > >>>>> fine in 0.13.0. However EFI BIOS itself is able to load kernel if it was > >>>>> properly configured on used disk image. The only effect is that > >>>>> neither VGA nor > >>>>> serial console is not functioning. After short investigation I > >>>>> have discovered > >>>>> that this functionality was broken by this commit: > >>>>> > >>>>> commit 9bb3358627d87d8de25fb41b7276575539d799a7 > >>>>> Author: Isaku Yamahata > >>>>> Date: Fri Nov 19 18:56:02 2010 +0900 > >>>>> > >>>>> Do you have any idea how this change could affect EFI consoles? > >>>>> > >>>>> > >>>> After further investigation I have found that the following patch provides > >>>> a workaround for the problem, may be it could be useful for somebody who > >>>> is more familiar with Qemu PCI code: > >>>> > >>>> diff --git a/hw/pci.c b/hw/pci.c > >>>> index 8b76cea..06dd7ab 100644 > >>>> --- a/hw/pci.c > >>>> +++ b/hw/pci.c > >>>> @@ -162,9 +162,11 @@ void pci_device_reset(PCIDevice *dev) > >>>> pci_update_irq_status(dev); > >>>> pci_device_deassert_intx(dev); > >>>> /* Clear all writeable bits */ > >>>> +#if 0 > >>>> pci_word_test_and_clear_mask(dev->config + PCI_COMMAND, > >>>> pci_get_word(dev->wmask + PCI_COMMAND) | > >>>> pci_get_word(dev->w1cmask + PCI_COMMAND)); > >>>> +#endif > >>>> pci_word_test_and_clear_mask(dev->config + PCI_STATUS, > >>>> pci_get_word(dev->wmask + PCI_STATUS) | > >>>> pci_get_word(dev->w1cmask + PCI_STATUS)); > >>>> > >>>> Best regards, > >>>> Artyom. > >>>> > >>>> > >>> -- > >>> yamahata > >>> > >>> > > > > -- > yamahata > -- yamahata