s390: introduce text_poke_sync()
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 1 Oct 2021 10:47:01 +0000 (12:47 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 11 Oct 2021 18:55:58 +0000 (20:55 +0200)
commite16d02ee3f348900a0a2cf41931b204e2042f5e3
treef4f16a8d00d83b5b78f328441efd00d4c84eb07d
parentfbbd140737121637b98aef53440c7a2676e412cf
s390: introduce text_poke_sync()

Introduce a text_poke_sync() similar to what x86 has. This can be
used to execute a serializing instruction on all CPUs (including
the current one).

Note: according to the Principles of Operation an IPI (= interrupt)
will already serialize a CPU, however it is better to be explicit. In
addition on_each_cpu() makes sure that also the current CPU get
serialized - just to make sure that possible preemption can prevent
some theoretical case where a CPU will not be serialized.

Therefore text_poke_sync() has to be used whenever code got modified,
just to avoid to rely on implicit serialization.

Also introduce text_poke_sync_lock() which will also disable CPU
hotplug, to prevent that any CPU is just going online with a
prefetched old version of a modified instruction.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/text-patching.h [new file with mode: 0644]
arch/s390/kernel/alternative.c