diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-07-25 11:47:02 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-07-25 11:47:02 +0200 |
| commit | 93081caaaed6a40a4f6d9b7ba3f581a4bb1d4404 (patch) | |
| tree | f574201ba58ddf9e6264f463e613066cfc8532ba /arch/arm/mm/init.c | |
| parent | 788faab70d5a882693286b8d5022779559c79904 (diff) | |
| parent | 7f635ff187ab6be0b350b3ec06791e376af238ab (diff) | |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm/mm/init.c')
| -rw-r--r-- | arch/arm/mm/init.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index c186474422f3..0cc8e04295a4 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -736,20 +736,29 @@ static int __mark_rodata_ro(void *unused) return 0; } +static int kernel_set_to_readonly __read_mostly; + void mark_rodata_ro(void) { + kernel_set_to_readonly = 1; stop_machine(__mark_rodata_ro, NULL, NULL); debug_checkwx(); } void set_kernel_text_rw(void) { + if (!kernel_set_to_readonly) + return; + set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false, current->active_mm); } void set_kernel_text_ro(void) { + if (!kernel_set_to_readonly) + return; + set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true, current->active_mm); } |
