From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Avi Kivity <avi@redhat.com>
Cc: Glauber Costa <glommer@redhat.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org,
stefano.stabellini@eu.citrix.com
Subject: [Qemu-devel] Re: [PATCH] hook cpu running at a higher level.
Date: Tue, 30 Dec 2008 14:44:08 +0000 [thread overview]
Message-ID: <18778.13240.800114.142038@mariner.uk.xensource.com> (raw)
In-Reply-To: <495A282D.20809@redhat.com>
Avi Kivity writes ("Re: [PATCH] hook cpu running at a higher level."):
> I thing it makes sense for you to have multiple vcpus -- that is
> multiple CPUState objects. You can still have just one thread (which
> would be the iothread in kvm's terminology).
Xen does have multiple vcpus (of course) but the vcpus are modelled
entirely in the hypervisor. No significant amount of state about
these vcpus is in qemu-dm. Because of the way qemu is constructed we
have to have a CPUState object in qemu-dm but there is only one of it
and it's basically a dummy. It doesn't contain any of the usual i386
registers.
This will all be a bit weird if you're used to thinking of qemu as a
whole system emulator (which is what it qemu, of course), but of
course Xen didn't need or want the whole system emulator.
>From the point of view of qemu's architecture, it's as if qemu were
emulating a machine consisting of the peripherals plus a (single)
pseudo-CPU which doesn't do anything resembling the execution of
machine instructions (at least as far as qemu is concerned). This
pseudo-CPU actually consists of much of the rest of the machine,
including the hypervisor and the guest (including all of the guest's
RAM). Since the state of this pseudo-CPU resides outside qemu, there
is no representation of it inside the qemu-dm process.
The the pseudo-CPU code in qemu-dm is mostly a stub which is
responsible for talking to the parts which actually run the pseudo-CPU
(ie, which actually run the guest's vcpus, maintain the guest's RAM,
and so forth).
> So:
> tcg - multiplexes all vcpus and io on one thread
> kvm - iothread + per-vcpu thread
> xen - iothread, vcpus scheduled by hypervisor
So qemu-dm _is_ the iothread. The vcpus are elsewhere.
Ian.
prev parent reply other threads:[~2008-12-30 14:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 18:29 [Qemu-devel] [PATCH] hook cpu running at a higher level Glauber Costa
2008-12-30 10:24 ` [Qemu-devel] " Ian Jackson
2008-12-30 10:44 ` Avi Kivity
2008-12-30 13:45 ` Ian Jackson
2008-12-30 11:35 ` Glauber Costa
2008-12-30 17:25 ` Ian Jackson
2008-12-30 13:54 ` Avi Kivity
2008-12-30 14:44 ` Ian Jackson [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=18778.13240.800114.142038@mariner.uk.xensource.com \
--to=ian.jackson@eu.citrix.com \
--cc=avi@redhat.com \
--cc=glommer@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
/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).