From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxzZo-0008IC-PI for qemu-devel@nongnu.org; Thu, 16 Feb 2012 06:32:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxzZi-0008Ia-Do for qemu-devel@nongnu.org; Thu, 16 Feb 2012 06:32:40 -0500 Received: from david.siemens.de ([192.35.17.14]:24070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxzZi-0008IP-3l for qemu-devel@nongnu.org; Thu, 16 Feb 2012 06:32:34 -0500 Message-ID: <4F3CE950.7050700@siemens.com> Date: Thu, 16 Feb 2012 12:32:32 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1329347774-23262-1-git-send-email-imammedo@redhat.com> <1329347774-23262-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1329347774-23262-5-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/7] cleanup: remove redundant pc_cpu_reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: "qemu-devel@nongnu.org" , "gleb@redhat.com" On 2012-02-16 00:16, Igor Mammedov wrote: > All cpus except of boot cpu should be halted after reset. > So remove redundant pc_cpu_reset and use cpu_reset instead. > > Signed-off-by: Igor Mammedov > --- > hw/pc.c | 11 ++--------- > target-i386/helper.c | 1 + > 2 files changed, 3 insertions(+), 9 deletions(-) > > diff --git a/hw/pc.c b/hw/pc.c > index d9c397a..3d35d78 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -928,14 +928,6 @@ typedef struct CPUPC { > CPUState state; > } CPUPC; > > -static void pc_cpu_reset(void *opaque) > -{ > - CPUState *env = opaque; > - > - cpu_reset(env); > - env->halted = !cpu_is_bsp(env); > -} > - > static int cpu_device_init(ICCBusDevice *dev) > { > CPUPC* cpu = DO_UPCAST(CPUPC, busdev, dev); > @@ -955,7 +947,8 @@ static int cpu_device_init(ICCBusDevice *dev) > static void cpu_device_reset(DeviceState *dev) { > CPUPC *cpu = DO_UPCAST(CPUPC, busdev.qdev, dev); > CPUState *env = &cpu->state; > - pc_cpu_reset(env); > + > + cpu_reset(env); > } > > static ICCBusDeviceInfo cpu_device_info = { > diff --git a/target-i386/helper.c b/target-i386/helper.c > index df2f5ba..cd61d36 100644 > --- a/target-i386/helper.c > +++ b/target-i386/helper.c > @@ -105,6 +105,7 @@ void cpu_reset(CPUX86State *env) > env->dr[7] = DR7_FIXED_1; > cpu_breakpoint_remove_all(env, BP_CPU); > cpu_watchpoint_remove_all(env, BP_CPU); > + env->halted = !cpu_is_bsp(env); > } > > void cpu_x86_close(CPUX86State *env) See http://thread.gmane.org/gmane.comp.emulators.qemu/100806 for an earlier attempt to clean this up. I forgot about following up on this, but you should try to adopt the suggestions to avoid repeating that discussion. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux