From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M26Kv-00069B-Ja for qemu-devel@nongnu.org; Thu, 07 May 2009 12:20:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M26Kq-000657-Lp for qemu-devel@nongnu.org; Thu, 07 May 2009 12:20:41 -0400 Received: from [199.232.76.173] (port=54509 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M26Kq-000654-Gc for qemu-devel@nongnu.org; Thu, 07 May 2009 12:20:36 -0400 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]:16245) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M26Kq-0006Tm-6e for qemu-devel@nongnu.org; Thu, 07 May 2009 12:20:36 -0400 From: Alex Williamson Date: Thu, 07 May 2009 10:16:03 -0600 Message-ID: <20090507161533.25315.52621.stgit@kvm.aw> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] bios: Use a different mask to size the option ROM BAR List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bochs-developers@lists.sourceforge.net Cc: alex.williamson@hp.com, qemu-devel@nongnu.org, kvm@vger.kernel.org Bit 0 is the enable bit, which we not only don't want to set, but it will stick and make us think it's an I/O port resource. Signed-off-by: Alex Williamson --- bios/rombios32.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index 269f175..616e70a 100644 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -948,11 +948,13 @@ static void pci_bios_init_device(PCIDevice *d) int ofs; uint32_t val, size ; - if (i == PCI_ROM_SLOT) + if (i == PCI_ROM_SLOT) { ofs = 0x30; - else + pci_config_writel(d, ofs, 0xfffffffe); + } else { ofs = 0x10 + i * 4; - pci_config_writel(d, ofs, 0xffffffff); + pci_config_writel(d, ofs, 0xffffffff); + } val = pci_config_readl(d, ofs); if (val != 0) { size = (~(val & ~0xf)) + 1;