There's this weird hack used by smp_text_poke_batch_finish() to indicate
a 'forced flush':
smp_text_poke_batch_flush(NULL);
Just open-code the vector-flush in a straightforward fashion:
smp_text_poke_batch_process(tp_vec, tp_vec_nr);
tp_vec_nr = 0;
And get rid of !addr hack from text_poke_addr_ordered().
Leave a WARN_ON_ONCE(), just in case some external code learned
to rely on this behavior.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250411054105.2341982-24-mingo@kernel.org
{
struct smp_text_poke_loc *tp;
+ WARN_ON_ONCE(!addr);
+
if (!tp_vec_nr)
return true;
- if (!addr) /* force */
- return false;
-
/*
* If the last current entry's address is higher than the
* new entry's address we'd like to add, then ordering
return true;
}
+void smp_text_poke_batch_finish(void)
+{
+ if (tp_vec_nr) {
+ smp_text_poke_batch_process(tp_vec, tp_vec_nr);
+ tp_vec_nr = 0;
+ }
+}
+
static void smp_text_poke_batch_flush(void *addr)
{
lockdep_assert_held(&text_mutex);
}
}
-void smp_text_poke_batch_finish(void)
-{
- smp_text_poke_batch_flush(NULL);
-}
-
void __ref smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, const void *emulate)
{
struct smp_text_poke_loc *tp;