diff options
author | Qiu Peiyang <[email protected]> | 2015-12-25 14:46:00 +0800 |
---|---|---|
committer | Steven Rostedt <[email protected]> | 2016-01-07 15:56:21 -0500 |
commit | 5156dca34a3e1e1edac2d0dabf43d8632909b7aa (patch) | |
tree | 9b75d4ecfe3d1d1b20d73f21baab2bf0b0969b70 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
parent | b7ffffbb46f205e7727a18bcc7a46c3c2b534f7c (diff) |
ftrace: Fix the race between ftrace and insmod
We hit ftrace_bug report when booting Android on a 64bit ATOM SOC chip.
Basically, there is a race between insmod and ftrace_run_update_code.
After load_module=>ftrace_module_init, another thread jumps in to call
ftrace_run_update_code=>ftrace_arch_code_modify_prepare
=>set_all_modules_text_rw, to change all modules
as RW. Since the new module is at MODULE_STATE_UNFORMED, the text attribute
is not changed. Then, the 2nd thread goes ahead to change codes.
However, load_module continues to call complete_formation=>set_section_ro_nx,
then 2nd thread would fail when probing the module's TEXT.
The patch fixes it by using notifier to delay the enabling of ftrace
records to the time when module is at state MODULE_STATE_COMING.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Qiu Peiyang <[email protected]>
Signed-off-by: Zhang Yanmin <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
0 files changed, 0 insertions, 0 deletions