qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] PCI-error with Beos 4.5 and Plan9


From: Fabrice Bellard
Subject: Re: [Qemu-devel] PCI-error with Beos 4.5 and Plan9
Date: Thu, 20 May 2004 13:40:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]