From patchwork Fri Dec 21 16:03:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10740677 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 9ED1513B5 for ; Fri, 21 Dec 2018 16:13:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D5C2284E4 for ; Fri, 21 Dec 2018 16:13:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8129C284ED; Fri, 21 Dec 2018 16:13:18 +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 0CF83284E4 for ; Fri, 21 Dec 2018 16:13:18 +0000 (UTC) Received: from localhost ([::1]:46467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaNQL-00022e-5L for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Dec 2018 11:13:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaNHN-0001dT-Fn for qemu-devel@nongnu.org; Fri, 21 Dec 2018 11:04:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaNHM-0004D5-Gl for qemu-devel@nongnu.org; Fri, 21 Dec 2018 11:04:01 -0500 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:33591) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaNHK-00047R-Go for qemu-devel@nongnu.org; Fri, 21 Dec 2018 11:03:58 -0500 Received: by mail-qk1-x72a.google.com with SMTP id o89so3363636qko.0 for ; Fri, 21 Dec 2018 08:03:46 -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=i5VRlBJXxsxNZX8ofxaIH9l0PPfVsIyemjtcRHurEggdU1upO3T75vMEMMQaS3aq57 P+u/PEaBJu6uYxklxO7snsysI3RvHBNULRMHWp7sA/HwqIIaWcyRNFx0QuAf+ZjloY3r BHpyAuqFtYxu4dIDzK5wtBAAXDke+y1Dlz1YmsDDkoj3dg1iD45zCwWJRGBMV+NNkyiY nkBnk3twCBY7Qq37LjwOc9XW/JaLQP9ysY1C98FDIdSDWYUuWDjkiREv20vwgaqwDWdO m2u5hBuWUZbn8Ai9tpmEHYif87CoIZlJGOB2fpllx2Z1co4o4lab1TrE0Z/GWMOfE+ya 9Phg== 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=Q8EOiYaWMgJ5f+QweOwf8CVI81nSn/V14veewa9f7ctcn0b7TRt4M6/Qlh6R45xlTe g+Vft2JwTOpuHk3UpHIe41By4tA1MiYBD/dB3Abps0xYuGdv8pupu+VdCKrvzwhU/krb okkVAx1I4+Br7X2AhSrqw51oZ0r6LUC6LxdXbLjpZu1ZnFEXW3oL5l+GNMm8X9tPRB/e dAqF5tMF/pfC7wbQcUqEr/JPDfI/bp1XUU58P+Mn+hTL1L49nXBBswcC//no7SsbakOs iLK9PspJgcgiu58KBMD8kO4H7VbMQY6cS/8giDrx135w9sTjLBh/m99pX31MtyTYlmJk R5Ow== X-Gm-Message-State: AJcUukcibYi7Vm42WLLUh8+tkKsZ1r0TxMTIc2lt7StKPIxsMt2pBX50 16F4qWPpoeJpL0b7nVd+ikjBgNkzRbo= X-Google-Smtp-Source: ALg8bN5E6/wcHqKSJTWLLgX85358q0sOVtwP/4yG41Zp/vwnghwX/2+D4xGm2LFBUtO55W8yA4UtOg== X-Received: by 2002:a37:96c2:: with SMTP id y185mr2692248qkd.239.1545408225952; Fri, 21 Dec 2018 08:03:45 -0800 (PST) Received: from localhost ([2601:182:c980:96c:8dd:4488:90b1:59d1]) by smtp.gmail.com with ESMTPSA id n3sm6635062qtc.81.2018.12.21.08.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 08:03:45 -0800 (PST) Date: Fri, 21 Dec 2018 08:03:00 -0800 Message-Id: <20181221160307.14819-8-palmer@sifive.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181221160307.14819-1-palmer@sifive.com> References: <20181221160307.14819-1-palmer@sifive.com> From: Palmer Dabbelt To: qemu-riscv@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72a 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: 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 {