From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53205 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Psf42-00050D-3o for qemu-devel@nongnu.org; Thu, 24 Feb 2011 12:33:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Psf40-00070c-KO for qemu-devel@nongnu.org; Thu, 24 Feb 2011 12:33:17 -0500 Received: from mail-vw0-f45.google.com ([209.85.212.45]:58802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Psf40-0006tC-Gj for qemu-devel@nongnu.org; Thu, 24 Feb 2011 12:33:16 -0500 Received: by mail-vw0-f45.google.com with SMTP id 19so689907vws.4 for ; Thu, 24 Feb 2011 09:33:16 -0800 (PST) Message-ID: <4D6695E6.7040004@codemonkey.ws> Date: Thu, 24 Feb 2011 11:31:18 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH V10 05/15] xen: Add xenfv machine References: <1296658172-16609-1-git-send-email-anthony.perard@citrix.com> <1296658172-16609-6-git-send-email-anthony.perard@citrix.com> In-Reply-To: <1296658172-16609-6-git-send-email-anthony.perard@citrix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony.perard@citrix.com Cc: Xen Devel , QEMU-devel , Stefano Stabellini On 02/02/2011 08:49 AM, anthony.perard@citrix.com wrote: > From: Anthony PERARD > > Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xen > specific call will be added in further patches. > > Signed-off-by: Anthony PERARD > --- > hw/pc.c | 19 +++++++++++++++++-- > hw/pc_piix.c | 21 ++++++++++++++++++++- > hw/xen.h | 4 ++++ > 3 files changed, 41 insertions(+), 3 deletions(-) > > diff --git a/hw/pc.c b/hw/pc.c > index 4dfdc0b..ab9d365 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -41,6 +41,7 @@ > #include "sysemu.h" > #include "blockdev.h" > #include "ui/qemu-spice.h" > +#include "xen.h" > > /* output Bochs bios info messages */ > //#define DEBUG_BIOS > @@ -906,7 +907,11 @@ static void pc_cpu_reset(void *opaque) > CPUState *env = opaque; > > cpu_reset(env); > - env->halted = !cpu_is_bsp(env); > + if (!xen_enabled()) { > + env->halted = !cpu_is_bsp(env); > + } else { > + env->halted = 1; > + } > } > > static CPUState *pc_new_cpu(const char *cpu_model) > @@ -940,7 +945,12 @@ void pc_cpus_init(const char *cpu_model) > #endif > } > > - for(i = 0; i< smp_cpus; i++) { > + if (!xen_enabled()) { > + for(i = 0; i< smp_cpus; i++) { > + pc_new_cpu(cpu_model); > + } > + } else { > + /* Xen require only one Qemu VCPU */ > pc_new_cpu(cpu_model); > } > } > @@ -968,6 +978,11 @@ void pc_memory_init(ram_addr_t ram_size, > *above_4g_mem_size_p = above_4g_mem_size; > *below_4g_mem_size_p = below_4g_mem_size; > > + if (xen_enabled()) { > + /* Nothing to do for Xen */ > + return; > + } > + > #if TARGET_PHYS_ADDR_BITS == 32 > if (above_4g_mem_size> 0) { > hw_error("To much RAM for 32-bit physical address"); > diff --git a/hw/pc_piix.c b/hw/pc_piix.c > index 7b74473..0ab8907 100644 > --- a/hw/pc_piix.c > +++ b/hw/pc_piix.c > @@ -36,6 +36,10 @@ > #include "sysbus.h" > #include "arch_init.h" > #include "blockdev.h" > +#include "xen.h" > +#ifdef CONFIG_XEN > +# include "xen/hvm/hvm_info_table.h" > +#endif > Admittedly a nit, but isn't this a system header? Regards, Anthony Liguori