mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: yunhui cui <cuiyunhui@bytedance.com>
Cc: conor.dooley@microchip.com, paul.walmsley@sifive.com,
	palmer@dabbelt.com, aou@eecs.berkeley.edu, peterz@infradead.org,
	mpe@ellerman.id.au, jpoimboe@kernel.org, mark.rutland@arm.com,
	svens@linux.ibm.com, guoren@kernel.org, jszhang@kernel.org,
	ebiederm@xmission.com, bjorn@rivosinc.com, heiko@sntech.de,
	xianting.tian@linux.alibaba.com, mnissler@rivosinc.com,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH v2] riscv: Dump user opcode bytes on fatal faults
Date: Thu, 17 Aug 2023 12:02:52 +0200	[thread overview]
Message-ID: <871qg29eb7.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <CAEEQ3w=MgH82+BMpwmUHnUevMJsJUqgeBRWSZnU_iizMLK37UQ@mail.gmail.com>

yunhui cui <cuiyunhui@bytedance.com> writes:

> Hi Björn,
>
> On Wed, Aug 16, 2023 at 11:11 PM Björn Töpel <bjorn@kernel.org> wrote:
>>
>> Hi Yunhui,
>>
>> Waking up the dead! ;-)
>>
>
>>
>> X86's show_opcodes() is used both for kernel oops:es, and userland
>> unhandled signals. On RISC-V there's dump_kernel_instr() added in commit
>> eb165bfa8eaf ("riscv: Add instruction dump to RISC-V splats").
>>
>> Wdyt about reworking that function, so that it works for userland epc as
>> well? I think it's useful to have the surrounding instruction context,
>> and not just on instruction.
>
> Okay,  Based on your suggestion, I'm going to rename dump_kernel_instr
> to dump_instr. Like:
> static void dump_instr(const char *loglvl, struct pt_regs *regs)
> {
> ...
>                 if (user_mode(regs))
>                         bad = get_user_nofault(val, &insns[i]);
>                 else
>                         bad = get_kernel_nofault(val, &insns[i]);
> ...
> }
>
> What do you think?

Yeah, looks good! Does that work for you?


Björn

  reply	other threads:[~2023-08-17 10:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  8:29 Yunhui Cui
2023-04-11 12:31 ` 运辉崔
2023-08-16 15:10 ` Björn Töpel
2023-08-17  8:23   ` [External] " yunhui cui
2023-08-17 10:02     ` Björn Töpel [this message]
2023-08-17 11:32       ` yunhui cui

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=871qg29eb7.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=bjorn@rivosinc.com \
    --cc=conor.dooley@microchip.com \
    --cc=cuiyunhui@bytedance.com \
    --cc=ebiederm@xmission.com \
    --cc=guoren@kernel.org \
    --cc=heiko@sntech.de \
    --cc=jpoimboe@kernel.org \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mnissler@rivosinc.com \
    --cc=mpe@ellerman.id.au \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=svens@linux.ibm.com \
    --cc=xianting.tian@linux.alibaba.com \
    /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

all inboxes | Powered by JetHome®