qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [4261] Errors while registering ioports are not fatal (Glauber Costa).
Date: Sat, 26 Apr 2008 16:09:59 -0500	[thread overview]
Message-ID: <48139A27.2030601@codemonkey.ws> (raw)
In-Reply-To: <200804262154.06555.paul@codesourcery.com>

Paul Brook wrote:
>>> I fail to see how hotplugging or proxing has anything to do with it. IO
>>> port registration is not something that can reasonably fail.
>>>
>>> If the real problem is that we can't cope with multiple devices
>>> registering the same IO port than you need to fix that. Blindly punting
>>> to the caller to
>>>       
>> There is no fix for that.  You can't have two devices that use the same
>> IO port.
>>     
>
> You probably can't meaningfully access the IO port. However I think the 
> registration itself should be allowed.
>
> The device shouldn't have to handle this. Just like real hardware doesn't. 
>   

We can be better than real hardware here.  In the ISA days, having to 
manually configure a cards IRQ lines to avoid conflicts was a huge pain 
for users.  This is not behavior we should strive to emulate :-)

> If you configure two devices with the same IO port I'd expect writes to go to 
> one or both of them, or cause a CPU fault. Just like when you have 
> overlapping memory ranges. The device doesn't suddenly disappear in a puff of 
> smoke because the OS assigned overlapping IO ranges.
>   

The issue isn't the guest OS assigning overlapping IO regions.  The 
issues is that some devices (like IDE), register ioports directly 
independently of PCI regions.

>>> cope is IMHO not an acceptable solution, especially when none of the
>>> callers check the return value.
>>>       
>> IO port range conflicts can still happen even with PCI devices.  Two PCI
>> IDE controllers would conflict with each other for instance.  It's much
>> more likely with ISA of course but it's still possible.  register_ioport
>> really should have a return code and callers should actively be checking
>> it.
>>     
>
> This is why bouncing the error to the device is the wrong thing to do. 
> Once the OS resolves the conflict I'd expect the remaining device to just 
> work.
>   

I don't know how hardware normally handles this.  If this is how normal 
hardware works, then we should emulate that.  It's also true though that 
exit()'ing in register_ioport is the wrong thing to do though.

Regards,

Anthony Liguori

> Paul
>   

  reply	other threads:[~2008-04-26 21:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-26 16:04 [Qemu-devel] [4261] Errors while registering ioports are not fatal (Glauber Costa) Andrzej Zaborowski
2008-04-26 19:26 ` Paul Brook
2008-04-26 19:36   ` Anthony Liguori
2008-04-26 19:57     ` Paul Brook
2008-04-26 20:33       ` Anthony Liguori
2008-04-26 20:45       ` Glauber Costa
2008-04-26 19:57   ` andrzej zaborowski
2008-04-26 20:08     ` Paul Brook
2008-04-26 20:38       ` Anthony Liguori
2008-04-26 20:54         ` Paul Brook
2008-04-26 21:09           ` Anthony Liguori [this message]
2008-04-26 21:29             ` Paul Brook
2008-04-26 20:39     ` Glauber Costa
2008-04-26 20:43     ` Anthony Liguori
2008-04-26 21:18       ` andrzej zaborowski

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=48139A27.2030601@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=paul@codesourcery.com \
    --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).