From patchwork Wed Jul 10 16:30:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 258161 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 902632C00A6 for ; Thu, 11 Jul 2013 02:31:20 +1000 (EST) Received: from localhost ([::1]:40400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwxIS-0000Pn-FH for incoming@patchwork.ozlabs.org; Wed, 10 Jul 2013 12:31:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwxIA-0000IP-2N for qemu-devel@nongnu.org; Wed, 10 Jul 2013 12:31:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwxI4-0001F9-OW for qemu-devel@nongnu.org; Wed, 10 Jul 2013 12:30:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38065 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwxI4-0001Ep-6I for qemu-devel@nongnu.org; Wed, 10 Jul 2013 12:30:52 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A5805A51CB; Wed, 10 Jul 2013 18:30:51 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 10 Jul 2013 18:30:38 +0200 Message-Id: <1373473838-1163-1-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Riku Voipio , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Eduardo Habkost Subject: [Qemu-devel] [PATCH RFC qom-cpu] linux-user: Avoid conditional cpu_reset() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Some CPUs reset as part of cpu_init(), some others were reset afterwards, some not at all. While some targets didn't implement a cpu_[state_]reset() function, QOM cpu_reset() is always available. There's nothing wrong with resetting twice on startup, so drop the #ifdef. Suggested-by: Peter Maydell Signed-off-by: Andreas Färber Cc: Eduardo Habkost --- This had been discussed as a possible cleanup for the #ifdef. I am uncertain whether we should do this since it hides the TODO item of investigating ppc and sparc CPU reset. linux-user/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 7f15d3d..e904d8c 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3637,9 +3637,7 @@ int main(int argc, char **argv, char **envp) fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } -#if defined(TARGET_SPARC) || defined(TARGET_PPC) cpu_reset(ENV_GET_CPU(env)); -#endif thread_cpu = ENV_GET_CPU(env);