[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEEQ3wme6nXoyK+_kFjrM6hV7EDfiPXM83dibfTS_XxPdbfpLQ@mail.gmail.com>
Date: Thu, 17 Aug 2023 19:32:43 +0800
From: yunhui cui <cuiyunhui@...edance.com>
To: Björn Töpel <bjorn@...nel.org>
Cc: conor.dooley@...rochip.com, paul.walmsley@...ive.com,
palmer@...belt.com, aou@...s.berkeley.edu, peterz@...radead.org,
mpe@...erman.id.au, jpoimboe@...nel.org, mark.rutland@....com,
svens@...ux.ibm.com, guoren@...nel.org, jszhang@...nel.org,
ebiederm@...ssion.com, bjorn@...osinc.com, heiko@...ech.de,
xianting.tian@...ux.alibaba.com, mnissler@...osinc.com,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [External] Re: [PATCH v2] riscv: Dump user opcode bytes on fatal faults
Hi Björn,
On Thu, Aug 17, 2023 at 6:03 PM Björn Töpel <bjorn@...nel.org> wrote:
>
> yunhui cui <cuiyunhui@...edance.com> writes:
>
> > Hi Björn,
> >
> > On Wed, Aug 16, 2023 at 11:11 PM Björn Töpel <bjorn@...nel.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?
Yeah, It works for me, I'll update the patch to v3 and send it.
Thanks,
Yunhui
Powered by blists - more mailing lists