From patchwork Wed Dec 26 17:19:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10743265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECFBD6C5 for ; Wed, 26 Dec 2018 17:38:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D17A226E51 for ; Wed, 26 Dec 2018 17:38:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF8D628787; Wed, 26 Dec 2018 17:38:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id A4EE726E51 for ; Wed, 26 Dec 2018 17:38:19 +0000 (UTC) Received: from localhost ([127.0.0.1]:47588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcD8M-0007xb-Bi for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Dec 2018 12:38:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcCrZ-0004Y1-G7 for qemu-devel@nongnu.org; Wed, 26 Dec 2018 12:20:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcCrX-0007zw-G6 for qemu-devel@nongnu.org; Wed, 26 Dec 2018 12:20:57 -0500 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:40296) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcCrX-0007l3-8j for qemu-devel@nongnu.org; Wed, 26 Dec 2018 12:20:55 -0500 Received: by mail-qk1-x732.google.com with SMTP id y16so9621685qki.7 for ; Wed, 26 Dec 2018 09:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:in-reply-to:references:cc:from:to; bh=6p7JyG3RH0lXqirJxx0bPeJBobxdYh1L5CqZ7x4vX6o=; b=kyb0Qz8V8wY086i8TVQOMrraM7uoNay3CSgQ/n6vVIYGGXXea+aVTCXHeUcIJ2zh1W rNzYRHizG8Gi5RDJM/xnQ78gByn4sUowSEXGeqOcFJF/9uspytkLDPv1s8dgtFdq2GTS eQZ8U5Y3JU/nQC3Katj0V9+y2PnPNC7AVE6k4g42OpklzbJb7d7jzV1QU/XhqNCx8FGU CsG/2G7jLscCRfv/6I9MFDiHQjdQ/9A+XdhDSshqj8AT+/jJfb1eHx8duQ+GTiINcw5I +x7Job7PeAOSEx+uLBu0A4ykmF0CkZLjWTfwihPELch7XPntEuvU1uHsKLb2YX0ICnax Petw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :cc:from:to; bh=6p7JyG3RH0lXqirJxx0bPeJBobxdYh1L5CqZ7x4vX6o=; b=R1vSALKKARVVE/oKsJ20AUWDvUmQ7CTiPCKRPToJLE4EfA0B/eQ1MLOabW3yNw8KuH q4NRUTh+5XSyg4USSLFlcKQJZbhnhFVTb38cIPpZjvFApUo+5dI+XEUpEsGDRTL63cD4 H+gTuDv1sCArmeytYw6IIdom3MHCLhll91DXQnyV1kLWIWbXAQ++KsJDSViRXjecMq4n sa6jla+BVmvmUeQ5cTvtZkJPow7vjhV2BWvVVtXxN/moLT/rfUP3w6BfUQxblsErk9Ds jdP5T8PyWewqZHKm1YrhBboWtJ4HsAk64vKfEaAD5do+mG8proaICzvh73Vzjv19GG9t 6qog== X-Gm-Message-State: AJcUukeZ8I9C0XToGH2RSXgdQwINTEARXGjvNQAcLF8YFcijab4p/WPJ ocwiTO3/HhGpzDdDdL5XBjl7BA== X-Google-Smtp-Source: ALg8bN7bTmlNmmT3SNyw9dsL1scCPDR2BKlRbj10fAUfd0WKUGy2dJ7XtLrqprHdA/1HafZO+kVvyQ== X-Received: by 2002:a37:cf02:: with SMTP id e2mr18435463qkj.38.1545844826382; Wed, 26 Dec 2018 09:20:26 -0800 (PST) Received: from localhost ([2601:182:c980:96c:8dd:4488:90b1:59d1]) by smtp.gmail.com with ESMTPSA id b75sm22195967qkh.4.2018.12.26.09.20.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Dec 2018 09:20:25 -0800 (PST) Date: Wed, 26 Dec 2018 09:19:58 -0800 Message-Id: <20181226172005.26990-8-palmer@sifive.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181226172005.26990-1-palmer@sifive.com> References: <20181226172005.26990-1-palmer@sifive.com> From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 Subject: [Qemu-devel] [PULL 07/14] RISC-V: Add hartid and \n to interrupt logging X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-riscv@nongnu.org, Sagar Karandikar , Bastian Koppelmann , Palmer Dabbelt , qemu-devel@nongnu.org, Michael Clark , Alistair Francis Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Clark Add carriage return that was erroneously removed when converting to qemu_log. Change hard coded core number to the actual hartid. Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: Palmer Dabbelt Cc: Alistair Francis Signed-off-by: Michael Clark Reviewed-by: Alistair Francis Signed-off-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- target/riscv/cpu_helper.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 86f9f4730c88..0234c2d52886 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -445,11 +445,13 @@ void riscv_cpu_do_interrupt(CPUState *cs) if (RISCV_DEBUG_INTERRUPT) { int log_cause = cs->exception_index & RISCV_EXCP_INT_MASK; if (cs->exception_index & RISCV_EXCP_INT_FLAG) { - qemu_log_mask(LOG_TRACE, "core 0: trap %s, epc 0x" TARGET_FMT_lx, - riscv_intr_names[log_cause], env->pc); + qemu_log_mask(LOG_TRACE, "core " + TARGET_FMT_ld ": trap %s, epc 0x" TARGET_FMT_lx "\n", + env->mhartid, riscv_intr_names[log_cause], env->pc); } else { - qemu_log_mask(LOG_TRACE, "core 0: intr %s, epc 0x" TARGET_FMT_lx, - riscv_excp_names[log_cause], env->pc); + qemu_log_mask(LOG_TRACE, "core " + TARGET_FMT_ld ": intr %s, epc 0x" TARGET_FMT_lx "\n", + env->mhartid, riscv_excp_names[log_cause], env->pc); } } @@ -511,8 +513,8 @@ void riscv_cpu_do_interrupt(CPUState *cs) if (hasbadaddr) { if (RISCV_DEBUG_INTERRUPT) { - qemu_log_mask(LOG_TRACE, "core " TARGET_FMT_ld - ": badaddr 0x" TARGET_FMT_lx, env->mhartid, env->badaddr); + qemu_log_mask(LOG_TRACE, "core " TARGET_FMT_ld ": badaddr 0x" + TARGET_FMT_lx "\n", env->mhartid, env->badaddr); } env->sbadaddr = env->badaddr; } else { @@ -536,8 +538,8 @@ void riscv_cpu_do_interrupt(CPUState *cs) if (hasbadaddr) { if (RISCV_DEBUG_INTERRUPT) { - qemu_log_mask(LOG_TRACE, "core " TARGET_FMT_ld - ": badaddr 0x" TARGET_FMT_lx, env->mhartid, env->badaddr); + qemu_log_mask(LOG_TRACE, "core " TARGET_FMT_ld ": badaddr 0x" + TARGET_FMT_lx "\n", env->mhartid, env->badaddr); } env->mbadaddr = env->badaddr; } else {