summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/alternative.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index c5801b4cbb66..16a41e29db17 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -2845,12 +2845,11 @@ static bool text_poke_addr_ordered(void *addr)
{
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
@@ -2864,6 +2863,14 @@ static bool text_poke_addr_ordered(void *addr)
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);
@@ -2874,11 +2881,6 @@ static void smp_text_poke_batch_flush(void *addr)
}
}
-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;