]> git.baikalelectronics.ru Git - kernel.git/commit
x86/alternatives: Implement a better poke_int3_handler() completion scheme
authorPeter Zijlstra <peterz@infradead.org>
Wed, 11 Dec 2019 00:25:57 +0000 (01:25 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 25 Dec 2019 09:43:29 +0000 (10:43 +0100)
commitd69d7945d074e75d9a9ffe778c6c06a3b55524ff
treed55b096ca95d131199abbaf6501510daedac653f
parentb709d534cdce77cdb509870b37722debcdc2effe
x86/alternatives: Implement a better poke_int3_handler() completion scheme

Commit:

  929a1207f241 ("x86/alternatives: Sync bp_patching update for avoiding NULL pointer exception")

added an additional text_poke_sync() IPI to text_poke_bp_batch() to
handle the rare case where another CPU is still inside an INT3 handler
while we clear the global state.

Instead of spraying IPIs around, count the active INT3 handlers and
wait for them to go away before proceeding to clear/reuse the data.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/alternative.c