]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: patch_text: Fixup last cpu should be master
authorGuo Ren <guoren@linux.alibaba.com>
Thu, 7 Apr 2022 07:33:20 +0000 (15:33 +0800)
committerWill Deacon <will@kernel.org>
Fri, 8 Apr 2022 10:43:46 +0000 (11:43 +0100)
commit78dd520eca48af17b9f6c09e87c7023f2484cf08
tree8822babc29f92bb2327da5bb31cf2286901fa73f
parentf29bb4c458074709396b91bf1d15e8ddee548cab
arm64: patch_text: Fixup last cpu should be master

These patch_text implementations are using stop_machine_cpuslocked
infrastructure with atomic cpu_count. The original idea: When the
master CPU patch_text, the others should wait for it. But current
implementation is using the first CPU as master, which couldn't
guarantee the remaining CPUs are waiting. This patch changes the
last CPU as the master to solve the potential risk.

Fixes: 732fbe69d571 ("arm64: introduce interfaces to hotpatch kernel and module code")
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220407073323.743224-2-guoren@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/patching.c