qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] directory hierarchy
Date: Sun, 23 Sep 2012 10:25:29 +0200	[thread overview]
Message-ID: <505EC779.5050600@redhat.com> (raw)
In-Reply-To: <CAAu8pHs8eA7r5_G2ngKkHw-HwwaspnDgwVwJutaF9FKYrYy_dQ@mail.gmail.com>

On 09/22/2012 04:15 PM, Blue Swirl wrote:
> >
> >> This could have nice cleanup effects though and for example enable
> >> generic 'info vmtree' to discover VA->PA mappings for any target
> >> instead of current MMU table walkers.
> >
> > How?  That's in a hardware defined format that's completely invisible to
> > the memory API.
>
> It's invisible now, but target-specific code could grab the mappings
> and feed them to memory API. Memory API would just see the per-CPU
> virtual memory as address spaces that map to physical memory address
> space.
>
> For RAM backed MMU tables like x86 and Sparc32, writes to page table
> memory areas would need to be tracked like SMC. For in-MMU TLBs, this
> would not be needed.
>
> Again, if performance would degrade, this would not be worthwhile. I'd
> expect VA->PA mappings to change at least at context switch rate +
> page fault rate + mmap/exec activity so this could amount to thousands
> of changes per second per CPU.
>
> In theory KVM could use memory API as CPU type agnostic way to
> exchange this information, I'd expect that KVM exit rate is not nearly
> as big and in many cases exchange of mapping information would not be
> needed. It would not improve performance there either.
>

First, the memory API does not operate at that level.  It handles (guest
physical) -> (host virtual | io callback) translations.  These are
(guest virtual) -> (guest physical translations).

Second, the memory API is machine-wide and designed for coarse maps. 
Processor memory maps are per-cpu and page-grained.  (the memory API
actually needs to efficiently support page-grained maps (for iommus) and
per-cpu maps (smm), but that's another story).

Third, we know from the pre-npt/ept days that tracking all mappings
destroys performance.  It's much better to do this on demand.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

  reply	other threads:[~2012-09-23  8:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 13:17 [Qemu-devel] directory hierarchy Paolo Bonzini
2012-09-14 13:36 ` Peter Maydell
2012-09-14 13:53   ` Paolo Bonzini
2012-09-16 14:40     ` Anthony Liguori
2012-09-17  7:47       ` Paolo Bonzini
2012-09-14 13:44 ` Luiz Capitulino
2012-09-14 14:03   ` Paolo Bonzini
2012-09-14 13:47 ` Daniel P. Berrange
2012-09-14 13:57   ` Paolo Bonzini
2012-09-14 13:48 ` Peter Maydell
2012-09-14 13:55   ` Paolo Bonzini
2012-09-14 14:00     ` Peter Maydell
2012-09-14 14:37 ` Stefan Weil
2012-09-14 16:36   ` Paolo Bonzini
2012-09-14 16:09 ` Kevin Wolf
2012-09-14 16:45   ` Paolo Bonzini
2012-09-14 19:51 ` Blue Swirl
2012-09-14 21:28   ` Paolo Bonzini
2012-09-19 12:54   ` Avi Kivity
2012-09-19 19:57     ` Blue Swirl
2012-09-20 11:31       ` Avi Kivity
2012-09-22 13:15         ` Blue Swirl
2012-09-23  8:25           ` Avi Kivity [this message]
2012-09-23 16:07             ` Blue Swirl
2012-09-24  9:54               ` Avi Kivity
2012-09-16 14:44 ` Anthony Liguori
2012-09-17  7:52   ` Paolo Bonzini
2012-09-17 13:04     ` Anthony Liguori

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=505EC779.5050600@redhat.com \
    --to=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=pbonzini@redhat.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).