qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Gwenole Beauchesne <gwenole.beauchesne@gmail.com>
Subject: Re: [Qemu-devel] 4G address space remapping on 64-bit host
Date: Fri, 29 Jun 2007 22:03:06 +0100	[thread overview]
Message-ID: <200706292203.07087.paul@codesourcery.com> (raw)
In-Reply-To: <e4e472910706291014l47b3149dv4aa4bbe54f5811c3@mail.gmail.com>

> > I'd expect the overhead of SIGSEGV+mmap to be prohibitive. I don't have
> > numbers to back this up, but experience with MIPS system emulation shows
> > that TLB miss cost can have significant effect on overall performance.
>
> I'd say this can't be worse than on MacOS X where Mach exception
> handling is terribly slow. Typically 100 usec per fault
> caught+mprotect where Linux requires less than 5 usec to do the same.

Maybe. I'll agree OSX memory management can be horribly slow[1].

> > Like Fabrice, I think this would be most useful in combination with some
> > sort of hypervisor.  Somewhere on my TODO list is porting qemu to run
> > directly as a paravirtual Xen DomU.  This means you can insert the guest
> > pagetable walk directly into the host mmu fault handler, and do clever
> > things with shadow pagetables.
>
> This would be great. As Fabrice mentioned, the tricky part would be to
> run the translator in the upper part or lower part of the 32-bit
> address space. Would fixing compilation with -pie help this (with some
> provisions for the dyngen ops) or do you see another means to achieve
> this?

My initial plan was to punt, and only worry about 64-bit hosts :-)

Using segmentation to chop a lump out of the address space is probably the 
simplest, and efficient as long as your OS doesn't try to access that area.
The hardest bit is emulating accesses that trap, but since we also control the 
(emulated) guest code we know which instructions we need to decode.

Paul

[1] This is from experience trying to make gcc go fast on that platform, not 
just random apple-bashing :-)

      reply	other threads:[~2007-06-29 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29  9:41 [Qemu-devel] 4G address space remapping on 64-bit host Blue Swirl
2007-06-29 10:15 ` Fabrice Bellard
2007-06-29 16:48   ` Blue Swirl
2007-06-29 20:48     ` Fabrice Bellard
2007-07-03  7:48       ` Blue Swirl
2007-06-29 13:00 ` Paul Brook
2007-06-29 17:14   ` Gwenole Beauchesne
2007-06-29 21:03     ` Paul Brook [this message]

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=200706292203.07087.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=gwenole.beauchesne@gmail.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).