From patchwork Thu Jan 28 21:53:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 8154441 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DE0F8BEEE5 for ; Thu, 28 Jan 2016 21:54:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09FFF20219 for ; Thu, 28 Jan 2016 21:54:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 004F520218 for ; Thu, 28 Jan 2016 21:54:13 +0000 (UTC) Received: from localhost ([::1]:58729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOuW4-0006CA-BQ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Jan 2016 16:54:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOuVq-00063S-CY for qemu-devel@nongnu.org; Thu, 28 Jan 2016 16:53:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOuVo-0004qQ-Vd for qemu-devel@nongnu.org; Thu, 28 Jan 2016 16:53:58 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:56473 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOuVi-0004pK-HV; Thu, 28 Jan 2016 16:53:50 -0500 Received: from gw-2.ac.upc.es (gw-2.ac.upc.es [147.83.30.8]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id u0SLrnAR020572; Thu, 28 Jan 2016 22:53:49 +0100 Received: from localhost (unknown [84.88.51.85]) by gw-2.ac.upc.es (Postfix) with ESMTPSA id 021E3A6; Thu, 28 Jan 2016 22:53:49 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Thu, 28 Jan 2016 22:53:48 +0100 Message-Id: <145401802859.13643.478507499991349592.stgit@localhost> X-Mailer: git-send-email 2.7.0.rc3 In-Reply-To: <145401801194.13643.11789300006832270147.stgit@localhost> References: <145401801194.13643.11789300006832270147.stgit@localhost> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id u0SLrnAR020572 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Cc: Thomas Huth , "open list:Overall" , Stefan Hajnoczi , "Dr . David Alan Gilbert" , Alexander Graf , "open list:PowerPC" , Paolo Bonzini , Markus Armbruster Subject: [Qemu-devel] [PATCH v5 3/5] util: [ppc] Use new error_report_fatal() instead of exit() 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: LluĂ­s Vilanova --- target-ppc/kvm.c | 5 +-- target-ppc/translate.c | 7 ++-- target-ppc/translate_init.c | 80 +++++++++++++++++++++---------------------- 3 files changed, 44 insertions(+), 48 deletions(-) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 9940a90..098a40d 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -316,9 +316,8 @@ static long gethugepagesize(const char *mem_path) } while (ret != 0 && errno == EINTR); if (ret != 0) { - fprintf(stderr, "Couldn't statfs() memory path: %s\n", - strerror(errno)); - exit(1); + error_report_fatal("Couldn't statfs() memory path: %s", + strerror(errno)); } #define HUGETLBFS_MAGIC 0x958458f6 diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 4be7eaa..2dfbbc2 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -11574,10 +11574,9 @@ void gen_intermediate_code(CPUPPCState *env, struct TranslationBlock *tb) break; } if (tcg_check_temp_count()) { - fprintf(stderr, "Opcode %02x %02x %02x (%08x) leaked temporaries\n", - opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode), - ctx.opcode); - exit(1); + error_report_fatal("Opcode %02x %02x %02x (%08x) leaked temporaries", + opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode), + ctx.opcode); } } if (tb->cflags & CF_LAST_IO) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index d7e1a4e..dc9bbd6 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -619,8 +619,8 @@ static inline void _spr_register(CPUPPCState *env, int num, spr->oea_read != NULL || spr->oea_write != NULL || #endif spr->uea_read != NULL || spr->uea_write != NULL) { - printf("Error: Trying to register SPR %d (%03x) twice !\n", num, num); - exit(1); + error_report_fatal("Error: Trying to register SPR %d (%03x) twice !", + num, num); } #if defined(PPC_DEBUG_SPR) printf("*** register spr %d (%03x) %s val " TARGET_FMT_lx "\n", num, num, @@ -1608,8 +1608,7 @@ static void gen_spr_BookE (CPUPPCState *env, uint64_t ivor_mask) for (i = 0; i < 64; i++) { if (ivor_mask & (1ULL << i)) { if (ivor_sprn[i] == SPR_BOOKE_IVORxx) { - fprintf(stderr, "ERROR: IVOR %d SPR is not defined\n", i); - exit(1); + error_report_fatal("ERROR: IVOR %d SPR is not defined", i); } spr_register(env, ivor_sprn[i], ivor_names[i], SPR_NOACCESS, SPR_NOACCESS, @@ -8319,14 +8318,14 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_VRE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_SPE or POWERPC_FLAG_VRE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should define POWERPC_FLAG_SPE or POWERPC_FLAG_VRE"); } } else if (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_SPE nor POWERPC_FLAG_VRE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should not define POWERPC_FLAG_SPE nor POWERPC_FLAG_VRE"); } if (env->msr_mask & (1 << 17)) { switch (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) { @@ -8334,14 +8333,14 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_CE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_TGPR or POWERPC_FLAG_CE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should define POWERPC_FLAG_TGPR or POWERPC_FLAG_CE"); } } else if (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_TGPR nor POWERPC_FLAG_CE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should not define POWERPC_FLAG_TGPR nor POWERPC_FLAG_CE"); } if (env->msr_mask & (1 << 10)) { switch (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE | @@ -8351,17 +8350,17 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_UBLE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_SE or POWERPC_FLAG_DWE or " - "POWERPC_FLAG_UBLE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should define POWERPC_FLAG_SE or POWERPC_FLAG_DWE or " + "POWERPC_FLAG_UBLE"); } } else if (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE | POWERPC_FLAG_UBLE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_SE nor POWERPC_FLAG_DWE nor " - "POWERPC_FLAG_UBLE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should not define POWERPC_FLAG_SE nor POWERPC_FLAG_DWE nor " + "POWERPC_FLAG_UBLE"); } if (env->msr_mask & (1 << 9)) { switch (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) { @@ -8369,14 +8368,14 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_DE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_BE or POWERPC_FLAG_DE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should define POWERPC_FLAG_BE or POWERPC_FLAG_DE"); } } else if (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_BE nor POWERPC_FLAG_DE\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should not define POWERPC_FLAG_BE nor POWERPC_FLAG_DE"); } if (env->msr_mask & (1 << 2)) { switch (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) { @@ -8384,19 +8383,19 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_PMM: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_PX or POWERPC_FLAG_PMM\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should define POWERPC_FLAG_PX or POWERPC_FLAG_PMM"); } } else if (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_PX nor POWERPC_FLAG_PMM\n"); - exit(1); + error_report("PowerPC MSR definition inconsistency"); + error_report_fatal( + "Should not define POWERPC_FLAG_PX nor POWERPC_FLAG_PMM"); } if ((env->flags & (POWERPC_FLAG_RTC_CLK | POWERPC_FLAG_BUS_CLK)) == 0) { - fprintf(stderr, "PowerPC flags inconsistency\n" - "Should define the time-base and decrementer clock source\n"); - exit(1); + error_report("PowerPC flags inconsistency"); + error_report_fatal( + "Should define the time-base and decrementer clock source"); } /* Allocate TLBs buffer when needed */ #if !defined(CONFIG_USER_ONLY) @@ -9570,8 +9569,7 @@ static void ppc_cpu_reset(CPUState *s) #if !defined(TARGET_WORDS_BIGENDIAN) msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */ if (!((env->msr_mask >> MSR_LE) & 1)) { - fprintf(stderr, "Selected CPU does not support little-endian.\n"); - exit(1); + error_report_fatal("Selected CPU does not support little-endian."); } #endif #endif