From nobody Mon Feb 9 12:34:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1598959489; cv=none; d=zohomail.com; s=zohoarc; b=iDPYMEmtVt83QvyxyzMGNBFmj+bZehgXgfIWJcYZr/r6uJ2RiPH7fbVcZ1vgXgOKEIwDRzT8mX29zQUKtJWYH2l0bArx3V/qs1+5hQPYFa32vDP3+ruXawD96rUQMFjDlGcx0h1Bx5AHq2NpxBs8UftFxcJdz6Tk+Fgz0cipqfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598959489; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zP3IEywFUeS5C8gvagLA5xd9b2pUw/aPOxuFN7Mi328=; b=c7Syfy6nfH0MCK75TUS9Kr+4VjSQlTam3do+i1RQgCL/Xc4QoxhfJHseza6Drl6yO0Q6GShAhg2txYJIEpLZKxe+Pc45we7ndApwnxEjr7qqOOzSz8z48JSuo+tAbhahjHQGAqZKIrTtZn2mNEvjc+Abtn6r0i8rJhzflai1f+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598959489709168.43007182884503; Tue, 1 Sep 2020 04:24:49 -0700 (PDT) Received: from localhost ([::1]:38060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD4PA-0000Gv-PN for importer@patchew.org; Tue, 01 Sep 2020 07:24:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD4Nu-0007RU-7L for qemu-devel@nongnu.org; Tue, 01 Sep 2020 07:23:30 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD4Ns-0007Lo-Hx for qemu-devel@nongnu.org; Tue, 01 Sep 2020 07:23:29 -0400 Received: by mail-wm1-x341.google.com with SMTP id u18so759910wmc.3 for ; Tue, 01 Sep 2020 04:23:28 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id n11sm1769124wrx.91.2020.09.01.04.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 04:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zP3IEywFUeS5C8gvagLA5xd9b2pUw/aPOxuFN7Mi328=; b=hCNHk9R/a298qcCMH1uXvY868Pzb0DqdwMb/nvg/0pkrCSAfcDv56qFdAvegsVC+AQ vjwirOyhtukkda9gKH1QAJr9xl7tLS8LrKLnnin6hBLL8/0653Hcnm8NFWwgrNtg8ZQh HLH+a3k7dMqpqguQOec7lTmp2/utLw8WoM24JxtcdNlcl7gy9S1e+SXEDW7Jd/S8KuLL 1ExspJTPa8M5df2UIDoOeYGbI9BGMA3GX/eSSb5Hm+C3o4Jp32ZI8hFE53CcVXcSAS/W utw/GIquBzu3XeJJtxb2trJfCho9XAosltQVMpup92pQNSmyXCuDZe9bWFgilcoyomg6 bGag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zP3IEywFUeS5C8gvagLA5xd9b2pUw/aPOxuFN7Mi328=; b=DKM94AnZOCi6rv7syNBmj5a6CIZ+WJGdP2FSTarBU/TctXiKhCw3j/vWuuUnrG8509 umHjW/TxCkGkBKUmNNvnz7lyzY8NhCbTYapAO5laFTxhYmRZZOq57YM99DLqGdBFbNgV H4wDYf7m+6CngdXFBhxTwpvBes8cIuzWv8Ns2le3GFEko/Lie8E84Jl5cCks7Y6o3Peh jhyimxyuyE3WruK24waplu4tpmaH+rCh82E305mNGtNCH8DXdtNEzfYuq3vkBO+KA7X6 lg0bfHVvSGKiAavAGq7YC7r0nRt/bhnC9aVjdoLBukvQ/31f3e4cW9sW6yIlmsPa+8o6 Tq/Q== X-Gm-Message-State: AOAM533qw9CUdX8TDo4YShEvtp0aeIe8euuq5zjiTLPcOHdtud0RIWbW /+FcGQydASLKBNiZVo+NO1HIrGOKYzw= X-Google-Smtp-Source: ABdhPJzHMwlfI2qMUnXGL8M8PbQoza3Wm/kL5dHI9qYeaZvEHi8rzCphEZX2okb4XMtSsFnp+ZVePw== X-Received: by 2002:a1c:3584:: with SMTP id c126mr1392522wma.13.1598959406725; Tue, 01 Sep 2020 04:23:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/2] cpus: Do not dump CPU state when calling hw_error() Date: Tue, 1 Sep 2020 13:23:22 +0200 Message-Id: <20200901112323.94969-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901112323.94969-1-f4bug@amsat.org> References: <20200901112323.94969-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Claudio Fontana , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We already have cpu_abort() to dump CPU states and abort. Restrict hw_error() to peripheral errors, hoping we can completely remove it by proper functions from "error-report.h" in the future. Suggested-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- softmmu/cpus.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index a802e899abb..c96a04d7f18 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -913,16 +913,11 @@ static void stop_tcg_kick_timer(void) void hw_error(const char *fmt, ...) { va_list ap; - CPUState *cpu; =20 va_start(ap, fmt); fprintf(stderr, "qemu: hardware error: "); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); - CPU_FOREACH(cpu) { - fprintf(stderr, "CPU #%d:\n", cpu->cpu_index); - cpu_dump_state(cpu, stderr, CPU_DUMP_FPU); - } va_end(ap); abort(); } --=20 2.26.2 From nobody Mon Feb 9 12:34:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1598959495; cv=none; d=zohomail.com; s=zohoarc; b=UCVapM6tkkJd95ub7cA9QkLhspyZk1GylyiGuobKmgf0a2Z2Td0ELMjGqCKvyuKEdJKZ5+vCVvKIJNHwvHlCE0T3N8AAJXcaa1XnxvsTvYC1eCbCwVS3BWMHUim9qylr2AigX1/Y+cTmeKSvzj9eIeZcX7kLpshs3ukcG8WDB34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598959495; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wv1z8GkqgKsVjWiNC8qcp304rCEdC3vesjm2CjFcbdc=; b=jaEP1TKP4K0ocGk8D9U7M8wxvVxEnZnm4ljTUD5NpEK6glqWPabM9KyJGhNp6JGBftRXh1B7Fls6xPyPvdIFsW+9/zs/sC+jqTLeYdnaTbI2UiJNE2kyYGSyvFRkHDxhh2PsbH5gqXsRdQtc2zLbTdf0KdAjqtkIAAzd3nbTFNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598959495332679.9461090295815; Tue, 1 Sep 2020 04:24:55 -0700 (PDT) Received: from localhost ([::1]:38260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD4PG-0000MX-Gl for importer@patchew.org; Tue, 01 Sep 2020 07:24:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD4Nv-0007S2-Hx for qemu-devel@nongnu.org; Tue, 01 Sep 2020 07:23:31 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:38193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD4Nt-0007M1-J8 for qemu-devel@nongnu.org; Tue, 01 Sep 2020 07:23:31 -0400 Received: by mail-wm1-x343.google.com with SMTP id l9so772585wme.3 for ; Tue, 01 Sep 2020 04:23:29 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id n11sm1769124wrx.91.2020.09.01.04.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 04:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wv1z8GkqgKsVjWiNC8qcp304rCEdC3vesjm2CjFcbdc=; b=oxkfmvoc+tv49In4qw4RDwiaxAjyQZdtCm0U6wwY2KAU7/3aJUnQfFldVDFvBNtdWs 1eiTvzlijjRR+aKowxntfv3OPlEEVhUmM1giUxmJ64vF5HQKmr0KkLDgkrgAcf8Vy7Y7 ThFoZDCm98syWMiUq/rilytk+0wSIN2sEJwnTs0+T5LQcjSx6X0tw7h2jDkpNErcXBj/ Bq9tcDwkXCYhe49+d6ihP6HmXUnNTt8vfiE/oG75LwjLABZyilAODNeabla4tkVe1vEj h/ShW9HP7o8jb/nrafK784zQV5h/Vkw/rtXodlMJmcDLT7MsKZI+JOPupwR2stTAPFM6 18kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wv1z8GkqgKsVjWiNC8qcp304rCEdC3vesjm2CjFcbdc=; b=nHNQKRj/WjAuIECgc6v0iXzSWuIWGrNjjAaDMJpGekd9daZZiQq18+KmDTr+rNklUx k1Hxy7CPDneNOVQlLbu3Z33IY+ALZNtMYW0+dXAYuq88eSGWF1cgM/tr2nRiFHxtJyNQ TZRZx91MzTTXI4UrrZ8bmbhUuqfJkQYM7VpyKAij6AJAE2YO3lOnn4H7U4qSPM/s4DgV 7ol9ezWiT6wzFQlNWUOh1U90HLV5/lF2ocf0+42oRlZ03sJdCouBgr+2Wm6YEESBpv6R i/z3INBVrcTKhTngHZ5WAypYokEA/kgQxAVfYRMQ6t1Ch69KUXPKC3l2S5PL5TIfVcyj juZA== X-Gm-Message-State: AOAM53331yJgo8FbC4TOX28gcpSPaCAqkZKyMs1Ao/gHJBjEU5bk/Xsw jcDsOp+XeJlfJ40znDbQztpaCHzJnHU= X-Google-Smtp-Source: ABdhPJyGlSVinMA/VUn7EvaA52UiwCjrpJJ0OmHvaOL+ZeoBX8O+Jj8iMeTjifKCP5b5qSfH8SmNPA== X-Received: by 2002:a1c:28d5:: with SMTP id o204mr1395173wmo.104.1598959407941; Tue, 01 Sep 2020 04:23:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/2] hw/core: Move hw_error() out of cpus.c Date: Tue, 1 Sep 2020 13:23:23 +0200 Message-Id: <20200901112323.94969-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901112323.94969-1-f4bug@amsat.org> References: <20200901112323.94969-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Claudio Fontana , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) As hw_error() is unrelated to CPU error - for which we have cpu_abort() - move it out of cpus.c, under the hw/ directory. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- Couldn't find better file/name to put it in... --- hw/core/error.c | 38 ++++++++++++++++++++++++++++++++++++++ softmmu/cpus.c | 12 ------------ hw/core/meson.build | 1 + 3 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 hw/core/error.c diff --git a/hw/core/error.c b/hw/core/error.c new file mode 100644 index 00000000000..5a783c82dff --- /dev/null +++ b/hw/core/error.c @@ -0,0 +1,38 @@ +/* + * Peripheral error reporting + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "hw/hw.h" + +void hw_error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + fprintf(stderr, "qemu: hardware error: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + abort(); +} diff --git a/softmmu/cpus.c b/softmmu/cpus.c index c96a04d7f18..eca57c76c9b 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -59,7 +59,6 @@ #include "sysemu/replay.h" #include "sysemu/runstate.h" #include "hw/boards.h" -#include "hw/hw.h" =20 #include "sysemu/cpu-throttle.h" =20 @@ -910,17 +909,6 @@ static void stop_tcg_kick_timer(void) } =20 /***********************************************************/ -void hw_error(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - fprintf(stderr, "qemu: hardware error: "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); - va_end(ap); - abort(); -} =20 void cpu_synchronize_all_states(void) { diff --git a/hw/core/meson.build b/hw/core/meson.build index fc91f980758..99466dc93fd 100644 --- a/hw/core/meson.build +++ b/hw/core/meson.build @@ -1,6 +1,7 @@ # core qdev-related obj files, also used by *-user and unit tests hwcore_files =3D files( 'bus.c', + 'error.c', 'fw-path-provider.c', 'hotplug.c', 'qdev-properties.c', --=20 2.26.2