From: Paul Brook <paul@codesourcery.com>
To: Robert Reif <reif@earthlink.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [5849] Change MMIO callbacks to use offsets, not absolute addresses.
Date: Tue, 24 Feb 2009 01:50:01 +0000 [thread overview]
Message-ID: <200902240150.01619.paul@codesourcery.com> (raw)
In-Reply-To: <49A34CFD.1010506@earthlink.net>
On Tuesday 24 February 2009, Robert Reif wrote:
> Paul Brook wrote:
> >> How do you propose having the hardware drivers generate meaningful and
> >> timely faults when an improper access is performed so it behaves like
> >> real low level software expects the hardware to behave?
> >
> > If you're wanting to generate faults from IO devices then getting the
> > right physical address is the least of your concerns. First you need to
> > figure out how to avoid corrupting the rest of the CPU state.
>
> The MMU does it so it must be possible. Is it a design issue, performance
> issue, just not worth the trouble or no one has really cared up until now?
> Please enlighten me further. Is it reasonable to expect it to work someday
> or should I just accept that it won't?
Bits of both. The TLB is tightly tied into the code generator. Once we get out
of the first-level TLB lookup you've not got anywhere near enough information
to be able to restore the CPU state. The only way to raise exceptions from
within an IO handler is to sync CPU state before every memory access, and you
really don't want to do that. This is why the existing unassigned access
fault code is busted.
In practice you probably want to have the IO handler set a flag somewhere
indicating that the access faulted, then add a check to the low-level TLB
code to fault in much the same way as for a TLB fault. You can probably avoid
slowing down the fast-path ram access case, but you're likely to take a hit
on all IO operations. Either way the fault mechanism is largely separate
from the device. I'm pretty sure this is consistent with read hardware where
the device just indicates that something bad happened, and the CPU figures
out everything else itself.
Paul
next prev parent reply other threads:[~2009-02-24 1:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 18:59 [Qemu-devel] [5849] Change MMIO callbacks to use offsets, not absolute addresses Paul Brook
2009-02-23 12:18 ` Robert Reif
2009-02-23 12:36 ` Paul Brook
2009-02-23 12:42 ` Robert Reif
2009-02-23 13:16 ` Paul Brook
2009-02-23 16:43 ` Robert Reif
2009-02-23 17:04 ` Paul Brook
2009-02-24 0:08 ` Robert Reif
2009-02-24 0:30 ` Paul Brook
2009-02-24 1:05 ` Robert Reif
2009-02-24 1:12 ` Paul Brook
2009-02-24 1:27 ` Robert Reif
2009-02-24 1:50 ` Paul Brook [this message]
2009-02-24 21:04 ` Blue Swirl
2009-02-24 22:28 ` Paul Brook
2009-02-25 19:54 ` Blue Swirl
2009-02-26 15:19 ` Paul Brook
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=200902240150.01619.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=reif@earthlink.net \
/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).