]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ARM: 9066/1: ftrace: pause/unpause function graph tracer in cpu_suspend()
authorlouis.wang <liang26812@gmail.com>
Wed, 24 Feb 2021 12:25:53 +0000 (13:25 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:26:47 +0000 (08:26 +0200)
commitafd1e8835b5740aac02ecba9b77800dbe4f09cfb
treee054e1a604b670ec8771a5972fc3a8a109013f32
parente1e5a4aa66dd8e7dcd70c26f64955419eb5e0f94
ARM: 9066/1: ftrace: pause/unpause function graph tracer in cpu_suspend()

BugLink: https://bugs.launchpad.net/bugs/1931896
[ Upstream commit 8252ca87c7a2111502ee13994956f8c309faad7f ]

Enabling function_graph tracer on ARM causes kernel panic, because the
function graph tracer updates the "return address" of a function in order
to insert a trace callback on function exit, it saves the function's
original return address in a return trace stack, but cpu_suspend() may not
return through the normal return path.

cpu_suspend() will resume directly via the cpu_resume path, but the return
trace stack has been set-up by the subfunctions of cpu_suspend(), which
makes the "return address" inconsistent with cpu_suspend().

This patch refers to Commit de818bd4522c40ea02a81b387d2fa86f989c9623
("arm64: kernel: pause/unpause function graph tracer in cpu_suspend()"),

fixes the issue by pausing/resuming the function graph tracer on the thread
executing cpu_suspend(), so that the function graph tracer state is kept
consistent across functions that enter power down states and never return
by effectively disabling graph tracer while they are executing.

Signed-off-by: louis.wang <liang26812@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/arm/kernel/suspend.c