[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANXhq0pc5STcmZRP5HZXZ_SxqSRq=izStMV0VQyPNM1ayEzszg@mail.gmail.com>
Date: Wed, 21 Oct 2020 15:10:39 +0800
From: Zong Li <zong.li@...ive.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Guo Ren <guoren@...nel.org>, Atish Patra <atishp@...shpatra.org>,
Palmer Dabbelt <palmerdabbelt@...gle.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Alan Kao <alankao@...estech.com>,
Patrick Stählin <me@...ki.ch>,
Guo Ren <guoren@...ux.alibaba.com>,
Anup Patel <anup@...infault.org>,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
linux-csky@...r.kernel.org, Greentime Hu <greentime.hu@...ive.com>,
linux-riscv <linux-riscv@...ts.infradead.org>
Subject: Re: [PATCH v4 9/9] riscv: Fixup lockdep_assert_held(&text_mutex) in patch_insn_write
On Wed, Oct 21, 2020 at 4:41 AM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> On Tue, 20 Oct 2020 19:18:01 +0800
> Guo Ren <guoren@...nel.org> wrote:
>
> > > What platform are you testing ? We are seeing a crash while enabling
> > > any of the tracers multiple times
> > > on Qemu/HiFive Unleashed.
> > I use qemu for testing. I've changed dynamic ftrace mechanism from
> > mcount to -fpatchable-entry.
> >
> > The problem is made by the lockdep checking of text_mutex.
>
> If you are switching to "patchable-entry" you shouldn't need to use
> stop_machine for the updates. No?
>
> -- Steve
Hi all,
I'm going to send the patch to fix the problem. Ftrace was broken from
v5.3 kernel version, and only happen on SMP. The problem is caused by
the following two patches:
Commit 4ecf0a43e729a7e641d800c294faabe87378fc05 ("processor: get rid
of cpu_relax_yield")
and
Commit 366237e7b0833faa2d8da7a8d7d7da8c3ca802e5 ("stop_machine:
Provide RCU quiescent state in multi_cpu_stop()")
We have to mark these two functions as notrace. The stopped CPUs
cannot make function calls to traceable functions on RISC-V, the
function call instruction pattern needs two instructions (auipc,
jalr), so there is a change to execute the (auipc + nop) or (nop,
jalr) when patching code.
There is a similar fix as follow:
Commit cb9d7fd51d9fbb329d182423bd7b92d0f8cb0e01 ("watchdog: Mark
watchdog touch functions as notrace")
I have verified my patches, and I'm going to send it to the mailing
list these few days.
Powered by blists - more mailing lists