From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKB8e-0002F8-Rc for qemu-devel@nongnu.org; Mon, 14 Dec 2009 08:39:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKB8Z-0002DT-IC for qemu-devel@nongnu.org; Mon, 14 Dec 2009 08:39:00 -0500 Received: from [199.232.76.173] (port=54092 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKB8Z-0002DM-BE for qemu-devel@nongnu.org; Mon, 14 Dec 2009 08:38:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58460) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKB8Z-0004as-1c for qemu-devel@nongnu.org; Mon, 14 Dec 2009 08:38:55 -0500 Date: Mon, 14 Dec 2009 15:36:10 +0200 From: "Michael S. Tsirkin" Message-ID: <20091214133610.GD973@redhat.com> References: <1260794906-30168-1-git-send-email-yamahata@valinux.co.jp> <1260794906-30168-3-git-send-email-yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1260794906-30168-3-git-send-email-yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH 02/11] pci: clean up pci_bar_address() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Mon, Dec 14, 2009 at 09:48:17PM +0900, Isaku Yamahata wrote: > make pci_bar_address independent of PCI_BAR_UNMAPPED value. > PCI_BAR_UNMAPPED could be arbitrary value which doesn't match > possible pci bar. So == PCI_BAR_UNMAPPED check is not good. > This patch cleans it up. > > Signed-off-by: Isaku Yamahata I would rather we removed this hack altogether. I guess proper fix requires Avi's patch to do BAR mapping from pci.c, and I think we should do just this. There are no special values in bar assignment, and guests are free to perform sizing any way they want. Especially for 64 bit BARs, sizing for high bits is done separately from low bits. Also - I think this in fact changes logic. On 64 bit qemu, we used to compare to 0xffffffff and now we compare to 0xffffffffffffffff. > --- > hw/pci.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index aed3a24..344d72b 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -857,8 +857,7 @@ static pcibus_t pci_bar_address(PCIDevice *d, > /* XXX: as we cannot support really dynamic > mappings, we handle specific values as invalid > mappings. */ > - if (last_addr <= new_addr || new_addr == 0 || > - last_addr == PCI_BAR_UNMAPPED) { > + if (last_addr <= new_addr || new_addr == 0 || last_addr == ~(pcibus_t)0) { > return PCI_BAR_UNMAPPED; > } > > -- > 1.6.5.4