From: Alex Williamson Subject: Re: [Qemu-devel] [PATCH] bios: Use the correct mask to size the PCI option ROM BAR Date: Tue, 12 May 2009 17:47:22 -0600 Message-ID: <1242172042.4788.42.camel@2710p.home> References: <1242167590.4788.20.camel@2710p.home> <200905122341.40706.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm-devel To: Paul Brook Return-path: Received: from g4t0015.houston.hp.com ([15.201.24.18]:1722 "EHLO g4t0015.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbZELXr2 (ORCPT ); Tue, 12 May 2009 19:47:28 -0400 In-Reply-To: <200905122341.40706.paul@codesourcery.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2009-05-12 at 23:41 +0100, Paul Brook wrote: > On Tuesday 12 May 2009, Alex Williamson wrote: > > 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. > > Why is the ROM slot special? Doesn't the same apply to all BARs? The PCI option (or expansion) ROM is assumed to be in MMIO space, so bit 0 becomes the enable bit rather than the memory space flag. The option ROM is also only a 4 byte register. The regular 6 base address registers can support MMIO or I/O port addresses and for PCI 2.0 (iirc), 2 regular base address registers can be combined to describe an 8 byte address. You can look at drivers/pci/probe.c:__pci_read_base() in the Linux source code and note that it makes the same special case for sizing the ROM BAR (~PCI_ROM_ADDRESS_ENABLE vs ~0). Alex