All of lore.kernel.org
 help / color / mirror / Atom feed
From: WANG Xuerui <kernel@xen0n.name>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: loongarch@lists.linux.dev, WANG Xuerui <git@xen0n.name>
Subject: [PATCH v2 08/11] LoongArch: Humanize the EUEN line when showing registers
Date: Thu, 29 Dec 2022 13:33:03 +0800	[thread overview]
Message-ID: <20221229053306.3285457-9-kernel@xen0n.name> (raw)
In-Reply-To: <20221229053306.3285457-1-kernel@xen0n.name>

From: WANG Xuerui <git@xen0n.name>

Example output looks like:

[   xx.xxxxxx]  euen: 00000000 (-BTE -ASXE -SXE -FPE)

Signed-off-by: WANG Xuerui <git@xen0n.name>
---
 arch/loongarch/kernel/traps.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c
index d1404d8c5a5c..a43f95631cea 100644
--- a/arch/loongarch/kernel/traps.c
+++ b/arch/loongarch/kernel/traps.c
@@ -209,6 +209,16 @@ static void print_prmd(unsigned long x)
 	pr_cont(")\n");
 }
 
+static void print_euen(unsigned long x)
+{
+	pr_cont(" euen: %08lx (", x);
+	print_bool_fragment("BTE", FIELD_GET(CSR_EUEN_LBTEN, x), true);
+	print_bool_fragment("ASXE", FIELD_GET(CSR_EUEN_LASXEN, x), false);
+	print_bool_fragment("SXE", FIELD_GET(CSR_EUEN_LSXEN, x), false);
+	print_bool_fragment("FPE", FIELD_GET(CSR_EUEN_FPEN, x), false);
+	pr_cont(")\n");
+}
+
 static void __show_regs(const struct pt_regs *regs)
 {
 	const int field = 2 * sizeof(unsigned long);
@@ -249,7 +259,7 @@ static void __show_regs(const struct pt_regs *regs)
 	/* Print important CSRs */
 	print_crmd(regs->csr_crmd);
 	print_prmd(regs->csr_prmd);
-	pr_cont(" euen: %08lx\n", regs->csr_euen);
+	print_euen(regs->csr_euen);
 	pr_cont(" ecfg: %08lx\n", regs->csr_ecfg);
 	pr_cont("estat: %08lx\n", regs->csr_estat);
 
-- 
2.38.1


  parent reply	other threads:[~2022-12-29  5:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29  5:32 [PATCH v2 00/11] LoongArch: Better backtraces WANG Xuerui
2022-12-29  5:32 ` [PATCH v2 01/11] LoongArch: Clean up the architectural interrupt definitions WANG Xuerui
2022-12-29  5:32 ` [PATCH v2 02/11] LoongArch: Add exception subcode definitions for the watchpoint exception WANG Xuerui
2022-12-29  5:32 ` [PATCH v2 03/11] LoongArch: Print GPRs with ABI names when showing registers WANG Xuerui
2022-12-29  5:32 ` [PATCH v2 04/11] LoongArch: Print symbol info for PC and $ra only for kernel-mode contexts WANG Xuerui
2022-12-29  5:33 ` [PATCH v2 05/11] LoongArch: Fix format of CSR lines during show_regs WANG Xuerui
2022-12-29  5:33 ` [PATCH v2 06/11] LoongArch: Humanize the CRMD line when showing registers WANG Xuerui
2022-12-29  5:33 ` [PATCH v2 07/11] LoongArch: Humanize the PRMD " WANG Xuerui
2022-12-29  5:33 ` WANG Xuerui [this message]
2022-12-29  5:33 ` [PATCH v2 09/11] LoongArch: Humanize the ECFG " WANG Xuerui
2022-12-29  5:33 ` [PATCH v2 10/11] LoongArch: Humanize the ESTAT " WANG Xuerui
2022-12-29  5:33 ` [PATCH v2 11/11] LoongArch: Use lowercase ISA manual names for BADV and CPUCFG.PRID lines in show_regs WANG Xuerui
2023-01-01  9:51 ` [PATCH v2 00/11] LoongArch: Better backtraces Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221229053306.3285457-9-kernel@xen0n.name \
    --to=kernel@xen0n.name \
    --cc=chenhuacai@kernel.org \
    --cc=git@xen0n.name \
    --cc=loongarch@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.