From patchwork Wed May 23 00:15:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10419889 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 C9AE360545 for ; Wed, 23 May 2018 00:28:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8F6428DAD for ; Wed, 23 May 2018 00:28:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD8E428DAE; Wed, 23 May 2018 00:28:19 +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 4BDF228DC3 for ; Wed, 23 May 2018 00:28:19 +0000 (UTC) Received: from localhost ([::1]:58550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLHda-0008Vc-Ju for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 May 2018 20:28:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLHTL-0008NK-43 for qemu-devel@nongnu.org; Tue, 22 May 2018 20:17:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLHTK-0000xQ-57 for qemu-devel@nongnu.org; Tue, 22 May 2018 20:17:43 -0400 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:38974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLHTJ-0000x4-V0 for qemu-devel@nongnu.org; Tue, 22 May 2018 20:17:42 -0400 Received: by mail-pf0-x22f.google.com with SMTP id a22-v6so9550470pfn.6 for ; Tue, 22 May 2018 17:17:41 -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=VdgQUgAlqY16lXjTIyfMHRPc7N+O0+bed93HlHFT6BE=; b=FsLGkphAs/3fS2cO1RPZyuRmTf+LW3o0GlSszjJEXsDEryTbgzxK/G+Mg19TPuqyTx J5cd9X1pNLyq/vNQUXQXCKbjsfu440gw94q7l8Y5xIYTEBxkHNsJ4NutKLP9/V/MIXlW ksj/t1SoM8r5GK5LQNwsf/bh11YFWiemb5OzVleT+BWahqzac2M2usOX9qMpuA7B2HkE QrfE+3u29bRBdOYtBUQN53R6H4a6EFrw6szzmmlCXL6rB0C5MhuZLX9Hoo6vgcETzfFk 7VhoSiX6iIQDF8HukdY5fSvmBBdjaeIWKNIT0m9GELUe968R6rJTjJtp0+Iwu6yxyj8x JDBw== 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=VdgQUgAlqY16lXjTIyfMHRPc7N+O0+bed93HlHFT6BE=; b=RDQ8aL6XNAcCeFE1Bacr5tW342qzETgSQznjamMMo8ucFVEK02uS4R1ZydgGUQ9xJe tKtXVP+tkkoYkQyAJKeHgIchZvtskzFIjDNxnn0CYVxlj9Ig2zxSTMv9fjAe/V5RJX8D TW8wPftVKQRsP/NQww3hQVLpU5Rv+xEvxWxI4FEK2+mEQ8KmWyMtR7yNryE8ryyjHcnJ 02OCAU/KpBscqB6rTkUf9utyAfdMKkZcfkX8i18jCl8NDJItjv0MDLcn2GfZHl44qVpI zgcXgrSEIw4pH39vAcEa/xEwWAPS2iGwIfkxcNAP0jbP9wvkj5cB4ED5GcToaReuyYNM 4KbA== X-Gm-Message-State: ALKqPwdqUsZ58IKx05cB8bDEw7czkc4073YOP9I1fbTlD8xim7eXAgir ymMtT9c++Z4QfcbuInjrDYNOICTYm7U= X-Google-Smtp-Source: AB8JxZr5yh36Ur8XnsRaQmIcXypW3qQwEQWaS6oWHJA1Y/aoz20thgGZOxBTIZrrHqLECA3vmgpppw== X-Received: by 2002:a65:5105:: with SMTP id f5-v6mr498672pgq.232.1527034661045; Tue, 22 May 2018 17:17:41 -0700 (PDT) Received: from localhost.localdomain (122-58-167-22-fibre.bb.spark.co.nz. [122.58.167.22]) by smtp.gmail.com with ESMTPSA id j1-v6sm28935626pfh.95.2018.05.22.17.17.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 17:17:40 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Wed, 23 May 2018 12:15:02 +1200 Message-Id: <1527034517-7851-16-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1527034517-7851-1-git-send-email-mjc@sifive.com> References: <1527034517-7851-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::22f Subject: [Qemu-devel] [PATCH v1 15/30] 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: Philippe Mathieu-Daudé 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 bc15e19022cc..69592c037042 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -446,11 +446,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); } } @@ -512,8 +514,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 { @@ -537,8 +539,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 {