Re: [PATCH v4 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"
From: Jiri Kosina
Date: Mon Nov 12 2018 - 05:59:17 EST
On Mon, 12 Nov 2018, Masami Hiramatsu wrote:
> > text_mutex is currently expected to be held before text_poke() is
> > called, but we kgdb does not take the mutex, and instead *supposedly*
> > ensures the lock is not taken and will not be acquired by any other
> > core while text_poke() is running.
> >
> > The reason for the "supposedly" comment is that it is not entirely clear
> > that this would be the case if gdb_do_roundup is zero.
> >
> > This patch creates two wrapper functions, text_poke() and
> > text_poke_kgdb() which do or do not run the lockdep assertion
> > respectively.
> >
> > While we are at it, change the return code of text_poke() to something
> > meaningful. One day, callers might actually respect it and the existing
> > BUG_ON() when patching fails could be removed. For kgdb, the return
> > value can actually be used.
>
> Hm, this looks reasonable and good to me.
>
> Reviewed-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Yes, I guess this is much better than putting the 'enforcement by comment'
back in place :)
Acked-by: Jiri Kosina <jkosina@xxxxxxx>
Thanks.
--
Jiri Kosina
SUSE Labs