From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Cc: Carsten Otte <cotte@de.ibm.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Hollis Blanchard <hollisb@us.ibm.com>,
kvm-devel <kvm@vger.kernel.org>,
Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH][RFC] Split non-TCG bits out of exec.c
Date: Fri, 14 Nov 2008 13:23:35 +0000 [thread overview]
Message-ID: <20081114132335.GC11975@shareable.org> (raw)
In-Reply-To: <491D4BC8.9090807@redhat.com>
Avi Kivity wrote:
> Jamie Lokier wrote:
> >But does the fact KVM doesn't use TCG prevent KVM from running some
> >x86 modes correctly? E.g. I gather 16-bit code is run by KVM using
> >VM86 mode, which is not exactly correct. It would be nice to have KVM
> >acceleration but also complete and correct emulation, by switching to
> >TCG for those modes.
>
> There is work in progress to make 16-bit emulation fully accurate.
Ooh! I want my Windows 95 to run in KVM :-)
I'm curious, how is this planned to work?
I'm having trouble thinking of how to do it without software emulation
at some stage.
> >Also, an earlier thread pointed out that loops doing a lot of MMIO are
> >_slower_ with KVM than without - this manifested as very slow VGA
> >output for some guests. Having KVM pass control to TCG for short runs
> >of guest instructions which do MMIO, or other instructions which need
> >to be emulated, would accelerate KVM in this respect.
(I think VMware does something like this, btw).
> Since TCG is not smp-safe, this is very problematic for smp guests. You
> would have to stop virtualization on all vcpus and start tcg on all of
> them. Performance would plummet.
On the other hand, when running on a KVM-capable architecture
combination, it is definitely possible to make TCG smp-safe because
every guest atomic instruction has a corresponding host one. It's
practically a 1:1 instruction mapping on x86, which doesn't have many
atomic instructions. (Maybe harder on other archs).
> There are ways of mitigating the high mmio cost with kvm. For
> framebuffers, one can allow kvm direct access. For other mmio, there's
> the 'coalesced mmio' support which allows mmio to be batched when this
> does not affect emulation accuracy and latency.
Don't you still have to trap for each MMIO in order to collect the
batch, except for REP instructions? It's the traps which are expensive.
Fortunately modern hardware tends to use DMA for data intensive
things, and MMIO just to trigger DMA, and initialisation.
-- Jamie
next prev parent reply other threads:[~2008-11-14 13:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 22:10 [Qemu-devel] [PATCH][RFC] Split non-TCG bits out of exec.c Anthony Liguori
2008-11-12 22:48 ` Fabrice Bellard
2008-11-12 22:53 ` Anthony Liguori
2008-11-13 13:51 ` andrzej zaborowski
2008-11-13 16:18 ` Anthony Liguori
2008-11-14 3:12 ` andrzej zaborowski
2008-11-14 3:18 ` Anthony Liguori
2008-11-14 13:45 ` andrzej zaborowski
2008-11-14 4:03 ` Jamie Lokier
2008-11-14 9:58 ` Avi Kivity
2008-11-14 13:23 ` Jamie Lokier [this message]
2008-11-16 13:07 ` Avi Kivity
2008-11-17 3:57 ` Jamie Lokier
2008-11-14 13:58 ` Anthony Liguori
2008-11-14 14:07 ` Anthony Liguori
2008-11-14 23:13 ` Jamie Lokier
2008-11-14 23:20 ` 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=20081114132335.GC11975@shareable.org \
--to=jamie@shareable.org \
--cc=aliguori@us.ibm.com \
--cc=cotte@de.ibm.com \
--cc=hollisb@us.ibm.com \
--cc=kvm@vger.kernel.org \
--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).