OSDN Git Service

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)
commit1f676247f36a4bdea134de5e8bc5041db9678c4e
treed55b096ca95d131199abbaf6501510daedac653f
parent46f5cfc13d54962097cb0cc5f97593e2a98a6aed
x86/alternatives: Implement a better poke_int3_handler() completion scheme

Commit:

  285a54efe386 ("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