From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl46Q-0008C2-1S for qemu-devel@nongnu.org; Wed, 11 Jan 2012 14:44:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl46O-00066k-Oq for qemu-devel@nongnu.org; Wed, 11 Jan 2012 14:44:53 -0500 Received: from mail-gx0-f173.google.com ([209.85.161.173]:49169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl46O-00066g-MR for qemu-devel@nongnu.org; Wed, 11 Jan 2012 14:44:52 -0500 Received: by ggnk1 with SMTP id k1so685044ggn.4 for ; Wed, 11 Jan 2012 11:44:52 -0800 (PST) Message-ID: <4F0DE6B0.4000609@codemonkey.ws> Date: Wed, 11 Jan 2012 13:44:48 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1326222656-26588-1-git-send-email-aliguori@us.ibm.com> <1326222656-26588-12-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/15] qtest: add support for target-i386 -M pc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 01/10/2012 01:56 PM, Paolo Bonzini wrote: > On 01/10/2012 08:10 PM, Anthony Liguori wrote: >> This involves forcing the CPU into the halted state if qtest is enabled and >> replacing the local APIC with the qtest interrupt controller. >> >> It should be pretty straight forward to do the same for other machine types on >> other architectures. >> >> Signed-off-by: Anthony Liguori >> --- >> hw/pc.c | 7 ++++++- >> hw/pc_piix.c | 9 ++++++--- >> 2 files changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/hw/pc.c b/hw/pc.c >> index 85304cf..fac5098 100644 >> --- a/hw/pc.c >> +++ b/hw/pc.c >> @@ -43,6 +43,7 @@ >> #include "ui/qemu-spice.h" >> #include "memory.h" >> #include "exec-memory.h" >> +#include "qtest.h" >> >> /* output Bochs bios info messages */ >> //#define DEBUG_BIOS >> @@ -926,7 +927,11 @@ static void pc_cpu_reset(void *opaque) >> CPUState *env = opaque; >> >> cpu_reset(env); >> - env->halted = !cpu_is_bsp(env); >> + if (qtest_enabled()) { >> + env->halted = 1; >> + } else { >> + env->halted = !cpu_is_bsp(env); >> + } > > This is wrong. qtest and Xen should simply not create the CPU threads at all. This is easier said than done. I started down this road and there's a huge amount of code that assumes that first_cpu != NULL. I agree it's where we want to go though. Regards, Anthony Liguori > > Paolo > > >