[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190206153418.722cc7f4a83d0e48c8dca552@kernel.org>
Date: Wed, 6 Feb 2019 15:34:18 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Daniel Bristot de Oliveira <bristot@...hat.com>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Jiri Kosina <jkosina@...e.cz>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Chris von Recklinghausen <crecklin@...hat.com>,
Jason Baron <jbaron@...mai.com>, Scott Wood <swood@...hat.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Clark Williams <williams@...hat.com>, x86@...nel.org
Subject: Re: [PATCH V4 8/9] jump_label: Batch updates if arch supports it
On Mon, 4 Feb 2019 20:59:01 +0100
Daniel Bristot de Oliveira <bristot@...hat.com> wrote:
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -407,6 +407,7 @@ bool jump_label_can_update_check(struct jump_entry *entry, bool init)
> return 0;
> }
>
> +#ifndef HAVE_JUMP_LABEL_BATCH
> static void __jump_label_update(struct static_key *key,
> struct jump_entry *entry,
> struct jump_entry *stop,
> @@ -419,6 +420,34 @@ static void __jump_label_update(struct static_key *key,
> }
> }
> }
> +#else
> +static void __jump_label_update(struct static_key *key,
> + struct jump_entry *entry,
> + struct jump_entry *stop,
> + bool init)
> +{
> + for_each_label_entry(key, entry, stop) {
> +
> + if (!jump_label_can_update_check(entry, init))
> + continue;
> +
> + if (arch_jump_label_transform_queue(entry,
> + jump_label_type(entry)))
> + continue;
> +
> + /*
> + * Queue's overflow: Apply the current queue, and then
> + * queue again. If it stills not possible to queue, BUG!
> + */
> + arch_jump_label_transform_apply();
> + if (!arch_jump_label_transform_queue(entry,
> + jump_label_type(entry))) {
> + BUG();
Please do not relay on BUG(), since in both case (applied or not),
jump_label is not critical for normal operation. I think you should use
WARN_ONCE() here and lock the jump_label so that root user can report it
to us :)
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists