Re: [PATCH] riscv: code patching only works on !XIP_KERNEL

From: Jisheng Zhang
Date: Tue May 11 2021 - 06:10:50 EST


On Mon, 10 May 2021 20:19:30 +0200 Vitaly Wool <vitaly.wool@xxxxxxxxxxxx> wrote:


>
>
> On Mon, May 10, 2021 at 6:35 PM Jisheng Zhang <jszhang3@xxxxxxxxxxxxxxxx> wrote:
> >
> > From: Jisheng Zhang <jszhang@xxxxxxxxxx>
> >
> > Some features which need code patching such as KPROBES, DYNAMIC_FTRACE
> > KGDB can only work on !XIP_KERNEL. Add dependencies for these features
> > that rely on code patching.
>
> Since we can define extra RW sections to place some tiny code bits in

I knew this discussion on maillist recently, that's the
reason why ERRATA_ALTERNATIVE related part isn't touched

> RAM, I would suggest that you hold back this patch for a while.
> I am not going to support the idea of e. g. compiling KGDB support
> into a XIP kernel, but disabling the whole HAVE_ARCH_JUMP_LABEL is
> hardly the way to go.
>

I'm not sure whether the solution "extra RW sections to place some tiny code
bits" can work for JUMP_LABEL or not. But obviously, in JUMP_LABEL users
such as static keys, the patching is taken on the .text section unless
patching the common implementation kernel/jump_label.c. IMHO it's impossible.

However, I can hold back this patch for a while as you suggested.

Thanks