From patchwork Wed Apr 25 23:45:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10364413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67EA26032C for ; Thu, 26 Apr 2018 00:06:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56CFA28FC3 for ; Thu, 26 Apr 2018 00:06:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 491F629022; Thu, 26 Apr 2018 00:06:47 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 B7E4B28FC3 for ; Thu, 26 Apr 2018 00:06:46 +0000 (UTC) Received: from localhost ([::1]:39654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBUQv-0004Lu-RE for patchwork-qemu-devel@patchwork.kernel.org; Wed, 25 Apr 2018 20:06:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBU9y-00064y-UH for qemu-devel@nongnu.org; Wed, 25 Apr 2018 19:49:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBU9y-0005if-5J for qemu-devel@nongnu.org; Wed, 25 Apr 2018 19:49:14 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBU9x-0005iG-VC for qemu-devel@nongnu.org; Wed, 25 Apr 2018 19:49:14 -0400 Received: by mail-pf0-x244.google.com with SMTP id j5so16590109pfh.2 for ; Wed, 25 Apr 2018 16:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ht9ppBaJdMqQ694tOlqVe3pTapn8E4otSC4m+acqNIA=; b=fYh3MxNSyUVI6UHlKynntA3QyW4q+DrAoa9e1NNXYojp6KLeUjKg/wCb4dp69nj7hn kWV6LiykwShpiUy9NbUPU7ODidU38/PVnRDj/OYRIA5Vh4aPEmdXOpe2vv3oocB/eKFj sgrN1LeMugIICshSovOM6pMH70OECj+GwQyKgAktdNKg1zBuayV5cjYY8zUOR763s2Km 10HOVSS/cs1csFkdLKOTQNfBB5udfUP/PVRLsxYXMML6tUGseu3ZbYUWcEmJrCpVYYFv 8r6tPlMFF0UqrsVPAQfSvNBdUZSDrATOxDlQvJnlBNSush/ornqJFXHTnOKvFvewwquu ZpHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ht9ppBaJdMqQ694tOlqVe3pTapn8E4otSC4m+acqNIA=; b=dZwK/JYn5q1yc0zp4jaPam6OMiB1CqA1EfjJNZPFnS8/8sR5h3InrO7wv7Rl1/uTi4 Hv2tjgJVDnrbcHC7VQCft284QTOzGf8AvzRtOq5CJtB5vUZxDE6WBOf4WNwG9bFNgK2+ A+Ky+UyIKeqxpYf9mJc4zd605bpRz+UVnqXQfsfTXlfpbkndhOTg3O2g1nF9Kdxsr0x4 KJ3Yg0+ua216HJ+gxf15y8DNU7BsIh3hap4u2rVW2kknrj9OFlJJfPnr4/t3jSU/MXfb wog0RyGHBfpMBn19nJOx2ugWU/tW3utU93sNDilG0S4yHZUUtyLlDDcCk6FTYhMZRKOD 74+A== X-Gm-Message-State: ALQs6tBZAEKzSBGwiVWVfzgqYS28xwFp2C9l8RJhSvLvMo85rikH4efY HnVLmLH2Jp9K90DSxHnwHouAng27FEE= X-Google-Smtp-Source: AB8JxZopMmkSAjUTQhcTPr1gwN8jItcnow8KhbhpOGWQ6iyEecsrY7jwjonAeS9JJ38CMqEiexhGOg== X-Received: by 10.101.76.130 with SMTP id m2mr5557208pgt.23.1524700152949; Wed, 25 Apr 2018 16:49:12 -0700 (PDT) Received: from localhost.localdomain (122-58-167-38-fibre.bb.spark.co.nz. [122.58.167.38]) by smtp.gmail.com with ESMTPSA id e10sm29577549pfn.67.2018.04.25.16.49.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Apr 2018 16:49:12 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Thu, 26 Apr 2018 11:45:37 +1200 Message-Id: <1524699938-6764-35-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1524699938-6764-1-git-send-email-mjc@sifive.com> References: <1524699938-6764-1-git-send-email-mjc@sifive.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH v8 34/35] 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 , Michael Clark , Alistair Francis , patches@groups.riscv.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 5d33f7b..a45885f 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 {