u8 len;
u8 opcode;
const u8 text[TEXT_POKE_MAX_OPCODE_SIZE];
- /* see smp_text_poke_batch_process() */
+ /* see smp_text_poke_batch_finish() */
u8 old;
};
return 0;
/*
- * Discount the INT3. See smp_text_poke_batch_process().
+ * Discount the INT3. See smp_text_poke_batch_finish().
*/
ip = (void *) regs->ip - INT3_INSN_SIZE;
}
/**
- * smp_text_poke_batch_process() -- update instructions on live kernel on SMP
+ * smp_text_poke_batch_finish() -- update instructions on live kernel on SMP
*
* Input state:
* text_poke_array.vec: vector of instructions to patch
* replacing opcode
* - SMP sync all CPUs
*/
-static void smp_text_poke_batch_process(void)
+void smp_text_poke_batch_finish(void)
{
unsigned char int3 = INT3_INSN_OPCODE;
unsigned int i;
int do_sync;
+ if (!text_poke_array.nr_entries)
+ return;
+
lockdep_assert_held(&text_mutex);
/*
return true;
}
-void smp_text_poke_batch_finish(void)
-{
- if (text_poke_array.nr_entries)
- smp_text_poke_batch_process();
-}
-
/**
* smp_text_poke_batch_add() -- update instruction on live kernel on SMP, batched
* @addr: address to patch
void __ref smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, const void *emulate)
{
if (text_poke_array.nr_entries == TEXT_POKE_ARRAY_MAX || !text_poke_addr_ordered(addr))
- smp_text_poke_batch_process();
+ smp_text_poke_batch_finish();
__smp_text_poke_batch_add(addr, opcode, len, emulate);
}