This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] Re: [Qemu-devel] [PATCH 03/15] xen: Add a new target to

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [Qemu-devel] [PATCH 03/15] xen: Add a new target to qemu: target-xen
From: Blue Swirl <blauwirbel@xxxxxxxxx>
Date: Fri, 13 Aug 2010 17:35:42 +0000
Cc: Anthony.Perard@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, qemu-devel@xxxxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx
Delivery-date: Fri, 13 Aug 2010 10:36:48 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=dP2jv9f4dTqfYVYsyvGvSEga8hy9LH+OGx7CG6HcYco=; b=COPVRbFgiB4bfh4fNHoVmDyRApXE3iaQ2yLHELWsps5OLQ1OBljfkBq629bG4BGBeE 28hGppEnRm9TjO/anJ6cOiCCs6FVHX3AZDZH3H5ADmp45h5LmQgUV7jPn+63BhCboPQ7 z5ZEfYeIX3p9ESxdtB8XedHT9WJr+tkcTYBoM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=HigHZfxzQQMOreOUJ5KiFNqYxjMI1bppT/QPQPhmLAwkHNAjtwt+SN0gcqGTJ7NbmP SM88b0V0A3CP9aSQsnS4nArQ/HjCvyev9CrvGFKbYsEFLbVkxITMYf9EKD3BCeFTljo7 NL2Pex11BUZIqkxgbToNNlSNzGyU9IP4TDY5o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19557.16086.677317.207260@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1008121244200.2545@kaball-desktop> <1281622202-3453-3-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <AANLkTimiij2BGt9eRmeLih+OUbdfy8W_+-zkFsysEoo8@xxxxxxxxxxxxxx> <19557.16086.677317.207260@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, Aug 13, 2010 at 12:47 PM, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> Blue Swirl writes ("[Xen-devel] Re: [Qemu-devel] [PATCH 03/15] xen: Add a new 
> target to qemu: target-xen"):
>> I don't understand why it would be a target, QEMU calls CPU
>> architectures targets. Isn't it possible to have Xen for Sparc, PPC or
>> ARM? It should really be just a machine, not copy&paste from x86
>> target.
> Qemu's targets include much more of Qemu's system emulation than is
> appropriate for Xen, because the hypervisor is doing more of the
> work.  For example, there is no representation of the guest CPU state
> outside the hypervisor so Qemu doesn't see that at all.

But you could easily ignore QEMU's CPU state, or even better would be
to support some kind of CPU state synchronization. KVM also manages
the CPU when it is charge, but at the transition points the state is
synched with QEMU state. For example, what should happen to CPU on
system reset on Xen? In this version, reset is completely ignored.

About the other changes, for example cpu_physical_memory_map() seems
to do very different things on Xen than QEMU. But this can be handled
easily by adding some kind of indirection to exec.c or just:
if (xen_enabled()) {
} else {

or add stubs for non-Xen case and then:


if (!xen_enabled()) {

> So it makes sense to do Xen emulation in Qemu as a new target than
> just as a machine.

It's also possible to add a new x86 CPU model like 'xen-x86'.

> Yes, in principle Xen for Sparc, PPC and ARM are possible; some of
> these have existed in the past although targets other than i386,
> itanium and amd64 aren't currently supported by xen-unstable.  So
> perhaps the currently-introduced xen target should be called
> target-i386-xen.  However, in practice since in a Xen system Qemu
> doesn't deal with CPU instructions these other targets will be much
> more like each other than (say) i386 is close to m68k.
> Or to put it all another way: from the point of view of Qemu, Xen is
> a weird kind of cpu architecture whose instruction emulation is done
> "by magic" and Qemu doesn't need to care vary much about that.

I don't see how this is so different from KVM, which is integrated to
QEMU cleanly. Even if the changes would be more invasive that way
(like the memory changes which KVM hasn't done so far), I'd still
think that would be better for everyone than having two versions of
the same code with some changes. They would eventually drift apart.

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>