From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUitJ-0004kw-O2 for qemu-devel@nongnu.org; Wed, 04 Feb 2009 09:38:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUitI-0004kY-Fu for qemu-devel@nongnu.org; Wed, 04 Feb 2009 09:38:13 -0500 Received: from [199.232.76.173] (port=37844 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUitI-0004kO-9i for qemu-devel@nongnu.org; Wed, 04 Feb 2009 09:38:12 -0500 Received: from mx20.gnu.org ([199.232.41.8]:45057) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LUitG-0007sm-AC for qemu-devel@nongnu.org; Wed, 04 Feb 2009 09:38:10 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LUitE-0006RI-BK for qemu-devel@nongnu.org; Wed, 04 Feb 2009 09:38:08 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [patch 13/18] qemu: warn if PCI region is not power of two Date: Wed, 4 Feb 2009 14:38:05 +0000 References: <20090204133303.113145633@localhost.localdomain> <20090204133924.445066836@localhost.localdomain> In-Reply-To: <20090204133924.445066836@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902041438.06018.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcelo Tosatti On Wednesday 04 February 2009, Marcelo Tosatti wrote: > Otherwise the PCI size for such regions can be calculated erroneously. > > Signed-off-by: Marcelo Tosatti > > Index: trunk/hw/pci.c > =================================================================== > --- trunk.orig/hw/pci.c > +++ trunk/hw/pci.c > @@ -249,6 +249,11 @@ void pci_register_io_region(PCIDevice *p > > if ((unsigned int)region_num >= PCI_NUM_REGIONS) > return; > + > + if (size & (size-1)) > + term_printf("WARNING: PCI region size must be pow2 " > + "type=0x%x, size=0x%x\n", type, size); > + This should be an error. It is a requirement of the PCI spec, and not something that's user configurable. Any odd sizes indicate a fairly serious bug elsewhere in qemu. Paul