From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BQncq-0005Ew-Os for qemu-devel@nongnu.org; Thu, 20 May 2004 09:30:20 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BQnOy-0001ap-3f for qemu-devel@nongnu.org; Thu, 20 May 2004 09:16:32 -0400 Received: from [193.252.22.25] (helo=mwinf0605.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BQnJv-0000no-D5 for qemu-devel@nongnu.org; Thu, 20 May 2004 09:10:47 -0400 Received: from mwinf0602.wanadoo.fr (mwinf0602 [172.22.137.24]) by mwinf0605.wanadoo.fr (SMTP Server) with ESMTP id 4A1A7C003C8A for ; Thu, 20 May 2004 13:38:46 +0200 (CEST) Received: from bellard.org (ATuileries-112-1-2-219.w80-14.abo.wanadoo.fr [80.14.188.219]) by mwinf0602.wanadoo.fr (SMTP Server) with ESMTP id 6279354000C3 for ; Thu, 20 May 2004 13:38:35 +0200 (CEST) Message-ID: <40AC9947.9090403@bellard.org> Date: Thu, 20 May 2004 13:40:55 +0200 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] PCI-error with Beos 4.5 and Plan9 References: <40ABE6F8.2070101@easynet.be> In-Reply-To: <40ABE6F8.2070101@easynet.be> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 Mark Jonckheere wrote: > Booting from an install-CD for Beos 4.5 and another one for Plan9 > with PCI enabled gives an error. It seems that the function > register_ioport_write() is called with an address (-4) outside > of its expected range (0-65535). > > It appears that both operating systems implement the procedure > described in the application note at page 204 from the document > "http://www.singlix.org/trdos/PCI22.pdf" with the special bits > already cleared. > > The following quick patch (against CVS 19-05-2004) works for me > in both cases. > > diff -wurb qemu/hw/pci.c qemu-patched/hw/pci.c > --- qemu/hw/pci.c Wed May 19 01:05:28 2004 > +++ qemu-patched/hw/pci.c Thu May 20 00:12:46 2004 > @@ -145,7 +145,7 @@ > r = &pci_dev->io_regions[reg]; > if (r->size == 0) > goto default_config; > - if (val != 0xffffffff && val != 0) { > + if ((val | 0x0f) != 0xffffffff && val != 0) { > /* XXX: the memory assignment should be global to handle > overlaps, but it is not needed at this stage */ > /* first unmap the old region */ > > > To be completely correct a distinction should be made between memory > and I/O addressing and in the second case a (val | 0x03) should be > used. I am not sure it is a good fix. From the PCI specs, the mapping should be done in all cases provided there are enabled in the PCI command register. So ultimately the test you are patching must be suppressed and the PCI command bits must be supported. Fabrice.