From: Alex Williamson Subject: [PATCH] bios: Use the correct mask to size the PCI option ROM BAR Date: Tue, 12 May 2009 16:33:10 -0600 Message-ID: <1242167590.4788.20.camel@2710p.home> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm-devel To: qemu-devel Return-path: Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:2049 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757090AbZELWda (ORCPT ); Tue, 12 May 2009 18:33:30 -0400 Sender: kvm-owner@vger.kernel.org List-ID: 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 --- diff --git a/bios/rombios32.c b/bios/rombios32.c index d7e18e9..f861f81 100644 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -985,11 +985,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;