aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-08-10 17:46:49 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2016-08-12 11:47:06 -0400
commit7619751f8c900fa5fdd76db06f4caf095c56de8e (patch)
treec4b0185d61b10af7b385e2c20cbe15137ac93097
parentd782e426b835bd2e79d868eb4af8510ed79e0aee (diff)
ARM: 8595/2: apply more __ro_after_init
Guided by grsecurity's analogous __read_only markings in arch/arm, this applies several uses of __ro_after_init to structures that are only updated during __init. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/kernel/cpuidle.c2
-rw-r--r--arch/arm/kernel/setup.c10
-rw-r--r--arch/arm/kernel/smp.c2
-rw-r--r--arch/arm/lib/delay.c2
-rw-r--r--arch/arm/mm/mmu.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c
index 7dccc964d75f..a3308ad1a024 100644
--- a/arch/arm/kernel/cpuidle.c
+++ b/arch/arm/kernel/cpuidle.c
@@ -19,7 +19,7 @@ extern struct of_cpuidle_method __cpuidle_method_of_table[];
19static const struct of_cpuidle_method __cpuidle_method_of_table_sentinel 19static const struct of_cpuidle_method __cpuidle_method_of_table_sentinel
20 __used __section(__cpuidle_method_of_table_end); 20 __used __section(__cpuidle_method_of_table_end);
21 21
22static struct cpuidle_ops cpuidle_ops[NR_CPUS]; 22static struct cpuidle_ops cpuidle_ops[NR_CPUS] __ro_after_init;
23 23
24/** 24/**
25 * arm_cpuidle_simple_enter() - a wrapper to cpu_do_idle() 25 * arm_cpuidle_simple_enter() - a wrapper to cpu_do_idle()
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index df7f2a75e769..aca999e17184 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -114,19 +114,19 @@ EXPORT_SYMBOL(elf_hwcap2);
114 114
115 115
116#ifdef MULTI_CPU 116#ifdef MULTI_CPU
117struct processor processor __read_mostly; 117struct processor processor __ro_after_init;
118#endif 118#endif
119#ifdef MULTI_TLB 119#ifdef MULTI_TLB
120struct cpu_tlb_fns cpu_tlb __read_mostly; 120struct cpu_tlb_fns cpu_tlb __ro_after_init;
121#endif 121#endif
122#ifdef MULTI_USER 122#ifdef MULTI_USER
123struct cpu_user_fns cpu_user __read_mostly; 123struct cpu_user_fns cpu_user __ro_after_init;
124#endif 124#endif
125#ifdef MULTI_CACHE 125#ifdef MULTI_CACHE
126struct cpu_cache_fns cpu_cache __read_mostly; 126struct cpu_cache_fns cpu_cache __ro_after_init;
127#endif 127#endif
128#ifdef CONFIG_OUTER_CACHE 128#ifdef CONFIG_OUTER_CACHE
129struct outer_cache_fns outer_cache __read_mostly; 129struct outer_cache_fns outer_cache __ro_after_init;
130EXPORT_SYMBOL(outer_cache); 130EXPORT_SYMBOL(outer_cache);
131#endif 131#endif
132 132
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 861521606c6d..937c8920d741 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -82,7 +82,7 @@ enum ipi_msg_type {
82 82
83static DECLARE_COMPLETION(cpu_running); 83static DECLARE_COMPLETION(cpu_running);
84 84
85static struct smp_operations smp_ops; 85static struct smp_operations smp_ops __ro_after_init;
86 86
87void __init smp_set_ops(const struct smp_operations *ops) 87void __init smp_set_ops(const struct smp_operations *ops)
88{ 88{
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index 8044591dca72..2cef11884857 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -29,7 +29,7 @@
29/* 29/*
30 * Default to the loop-based delay implementation. 30 * Default to the loop-based delay implementation.
31 */ 31 */
32struct arm_delay_ops arm_delay_ops = { 32struct arm_delay_ops arm_delay_ops __ro_after_init = {
33 .delay = __loop_delay, 33 .delay = __loop_delay,
34 .const_udelay = __loop_const_udelay, 34 .const_udelay = __loop_const_udelay,
35 .udelay = __loop_udelay, 35 .udelay = __loop_udelay,
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 62f4d01941f7..2396935e715c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -243,7 +243,7 @@ __setup("noalign", noalign_setup);
243#define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE 243#define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE
244#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE 244#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE
245 245
246static struct mem_type mem_types[] = { 246static struct mem_type mem_types[] __ro_after_init = {
247 [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ 247 [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */
248 .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | 248 .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED |
249 L_PTE_SHARED, 249 L_PTE_SHARED,