From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkhoX-0002ZN-IJ for qemu-devel@nongnu.org; Tue, 10 Jan 2012 14:57:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkhoW-0005np-CL for qemu-devel@nongnu.org; Tue, 10 Jan 2012 14:56:57 -0500 Received: from lo.gmane.org ([80.91.229.12]:39168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkhoW-0005nl-7F for qemu-devel@nongnu.org; Tue, 10 Jan 2012 14:56:56 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RkhoS-0008QG-VY for qemu-devel@nongnu.org; Tue, 10 Jan 2012 20:56:52 +0100 Received: from 93-34-200-238.ip51.fastwebnet.it ([93.34.200.238]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Jan 2012 20:56:52 +0100 Received: from pbonzini by 93-34-200-238.ip51.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Jan 2012 20:56:52 +0100 From: Paolo Bonzini Date: Tue, 10 Jan 2012 20:56:40 +0100 Message-ID: References: <1326222656-26588-1-git-send-email-aliguori@us.ibm.com> <1326222656-26588-12-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <1326222656-26588-12-git-send-email-aliguori@us.ibm.com> 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: qemu-devel@nongnu.org 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. Paolo