Linux-RISC-V Archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: takakura@valinux.co.jp, paul.walmsley@sifive.com,
	palmer@dabbelt.com, aou@eecs.berkeley.edu,
	apatel@ventanamicro.com, bmeng.cn@gmail.com, atishp@rivosinc.com,
	daniel.thompson@linaro.org, arnd@arndb.de, sfr@canb.auug.org.au,
	akpm@linux-foundation.org, conor.dooley@microchip.com,
	samuel.holland@sifive.com
Cc: taka@valinux.co.jp, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ryo Takakura <takakura@valinux.co.jp>
Subject: Re: [PATCH] RISC-V: Enable IPI CPU Backtrace
Date: Wed, 17 Apr 2024 09:26:13 +0200	[thread overview]
Message-ID: <87bk68fo16.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20240417050711.41930-1-takakura@valinux.co.jp>

takakura@valinux.co.jp writes:

> From: Ryo Takakura <takakura@valinux.co.jp>
>
> Add CPU backtrace feature using IPI on riscv.
> Currently, riscv doesn't yet support the feature while other
> architectures do. As IPI multiplexing allows to handle 
> multiple IPIs, I think this feature can also be enabled 
> on riscv by adding IPI.
>
> This patch defines arch_trigger_all_cpu_backtrace() which triggers
> the IPI for CPU backtrace.
> It will be triggered in the events of oops/panic when options
> (oops_all_cpu_backtrace/panic_print) are set accordingly.
>
> Below is the case of oops with the oops_all_cpu_backtrace 
> enabled.
>
> $ sysctl kernel.oops_all_cpu_backtrace=1
>
> triggering oops shows:
> [  435.716754] NMI backtrace for cpu 3
> [  435.716893] CPU: 3 PID: 621 Comm: in:imklog Tainted: G           OE      6.9.0-rc4 #1
> [  435.717086] Hardware name: riscv-virtio,qemu (DT)
> [  435.717182] epc : fallback_scalar_usercopy+0x8/0xdc
> [  435.717300]  ra : _copy_to_user+0x32/0x58
> [  435.717391] epc : ffffffff80c33d88 ra : ffffffff80598e3c sp : ff20000000e83b50
> [  435.717544]  gp : ffffffff82066bf0 tp : ff60000091fd7000 t0 : 3363303866660000
> [  435.717711]  t1 : 000000000000005b t2 : 3363303866666666 s0 : ff20000000e83b60
> [  435.717874]  s1 : 00000000000001af a0 : 00007ff74d3df74f a1 : ff60000082cdc800
> [  435.718040]  a2 : 000000000000003c a3 : 0000000000000000 a4 : 0000000000000000
> [  435.718196]  a5 : 00ffffffffffffc4 a6 : 0000000000000000 a7 : 0000000000000010
> [  435.718333]  s2 : ff60000082cdc800 s3 : ffffffff82066910 s4 : 0000000000001df1
> [  435.718475]  s5 : ffffffff8206a5b8 s6 : 00007ff74d3df74f s7 : ffffffff8206a5b0
> [  435.718616]  s8 : ff60000082cdc800 s9 : ffffffff81e26208 s10: 000000000000003c
> [  435.718760]  s11: ffffffff8206a5ad t3 : ff60000082cdc812 t4 : ff60000082cdc812
> [  435.718909]  t5 : ff60000082cdc818 t6 : 0000000000040000
> [  435.719019] status: 0000000000040120 badaddr: 0000000000000000 cause: 8000000000000001
> [  435.719191] [<ffffffff80c33d88>] fallback_scalar_usercopy+0x8/0xdc
> [  435.719330] [<ffffffff80094eee>] syslog_print+0x1f4/0x2b2
> [  435.719446] [<ffffffff80095e10>] do_syslog.part.0+0xb0/0x326
> [  435.719594] [<ffffffff8009692e>] do_syslog+0x66/0x88
> [  435.719816] [<ffffffff803a1a80>] kmsg_read+0x44/0x5c
> [  435.720017] [<ffffffff8038ea92>] proc_reg_read+0x7a/0xa8
> [  435.720251] [<ffffffff802fae20>] vfs_read+0x94/0x264
> [  435.720478] [<ffffffff802fb906>] ksys_read+0x64/0xe4
> [  435.720709] [<ffffffff802fb9a6>] __riscv_sys_read+0x20/0x2c
> [  435.720880] [<ffffffff80c43ea2>] do_trap_ecall_u+0x60/0x1d4
> [  435.721236] [<ffffffff80c4f74c>] ret_from_exception+0x0/0x64
>
> Signed-off-by: Ryo Takakura <takakura@valinux.co.jp>

Reviewed-by: Björn Töpel <bjorn@rivosinc.com>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2024-04-17  7:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  5:07 [PATCH] RISC-V: Enable IPI CPU Backtrace takakura
2024-04-17  7:26 ` Björn Töpel [this message]

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=87bk68fo16.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=apatel@ventanamicro.com \
    --cc=arnd@arndb.de \
    --cc=atishp@rivosinc.com \
    --cc=bmeng.cn@gmail.com \
    --cc=conor.dooley@microchip.com \
    --cc=daniel.thompson@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=samuel.holland@sifive.com \
    --cc=sfr@canb.auug.org.au \
    --cc=taka@valinux.co.jp \
    --cc=takakura@valinux.co.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).