qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] PCI-error with Beos 4.5 and Plan9
Date: Thu, 20 May 2004 13:40:55 +0200	[thread overview]
Message-ID: <40AC9947.9090403@bellard.org> (raw)
In-Reply-To: <40ABE6F8.2070101@easynet.be>

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	other threads:[~2004-05-20 13:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 23:00 [Qemu-devel] PCI-error with Beos 4.5 and Plan9 Mark Jonckheere
2004-05-20 11:40 ` Fabrice Bellard [this message]
2004-05-20 14:11 ` Fabrice Bellard
2004-05-22 13:46   ` [Qemu-devel] " Mark Jonckheere

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40AC9947.9090403@bellard.org \
    --to=fabrice@bellard.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).