linux/arch/arm64
William Cohen a1dd586647 Correct the race condition in aarch64_insn_patch_text_sync()
commit 899d5933b2 upstream.

When experimenting with patches to provide kprobes support for aarch64
smp machines would hang when inserting breakpoints into kernel code.
The hangs were caused by a race condition in the code called by
aarch64_insn_patch_text_sync().  The first processor in the
aarch64_insn_patch_text_cb() function would patch the code while other
processors were still entering the function and incrementing the
cpu_count field.  This resulted in some processors never observing the
exit condition and exiting the function.  Thus, processors in the
system hung.

The first processor to enter the patching function performs the
patching and signals that the patching is complete with an increment
of the cpu_count field. When all the processors have incremented the
cpu_count field the cpu_count will be num_cpus_online()+1 and they
will return to normal execution.

Fixes: ae16480785 arm64: introduce interfaces to hotpatch kernel and module code
Signed-off-by: William Cohen <wcohen@redhat.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-21 09:23:02 -08:00
..
boot arm64: dts: Reduce size of virtio block device for foundation model 2013-12-20 16:20:21 +00:00
configs arm64: defconfig: Expand default enabled features 2014-02-07 17:17:28 +00:00
include arm64: compat: fix compat types affecting struct compat_elf_prpsinfo 2014-10-30 09:38:24 -07:00
kernel Correct the race condition in aarch64_insn_patch_text_sync() 2014-11-21 09:23:02 -08:00
kvm ARM/ARM64: KVM: Nuke Hyp-mode tlbs before enabling MMU 2014-10-05 14:52:10 -07:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-21 09:23:02 -08:00
mm arm64: mm: Make icache synchronisation logic huge page aware 2014-07-09 11:18:26 -07:00
xen xen/arm,arm64: enable SWIOTLB_XEN 2013-10-10 13:40:44 +00:00
Kconfig locking/mutex: Disable optimistic spinning on some architectures 2014-07-28 08:06:03 -07:00
Kconfig.debug arm64: Remove duplicate DEBUG_STACK_USAGE config 2013-10-02 18:03:26 +01:00
Makefile arm64: big-endian: add big-endian support to top-level arch Makefile 2013-10-25 15:59:31 +01:00