diff options
author | David Rientjes <rientjes@google.com> | 2014-02-05 02:55:06 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-02-09 09:15:11 -0500 |
commit | dc9788f40a769d967de3eb5a7aee8c1a70094d32 (patch) | |
tree | 3ac3cbc1a35f7ea668b812818a472f4cec72850e /arch/x86 | |
parent | 6d4989835e5418fdfda764fce7294246f80cf464 (diff) |
x86/apic: Always define nox2apic and define it as initdata
The "nox2apic" variable can be defined as __initdata since it is
only used for bootstrap. It can now unconditionally be defined
since it will later be freed.
At the same time, it is also better off as a bool.
Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1402042354380.7839@chino.kir.corp.google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/apic.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index b4c561dbe3ba..19b0ebafcd3e 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -217,7 +217,6 @@ static inline void x2apic_force_phys(void) | |||
217 | { | 217 | { |
218 | } | 218 | } |
219 | 219 | ||
220 | #define nox2apic 0 | ||
221 | #define x2apic_preenabled 0 | 220 | #define x2apic_preenabled 0 |
222 | #define x2apic_supported() 0 | 221 | #define x2apic_supported() 0 |
223 | #endif | 222 | #endif |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 7f26c9a70a9e..f824d697db19 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -133,6 +133,10 @@ static inline void imcr_apic_to_pic(void) | |||
133 | * +1=force-enable | 133 | * +1=force-enable |
134 | */ | 134 | */ |
135 | static int force_enable_local_apic __initdata; | 135 | static int force_enable_local_apic __initdata; |
136 | |||
137 | /* Control whether x2APIC mode is enabled or not */ | ||
138 | static bool nox2apic __initdata; | ||
139 | |||
136 | /* | 140 | /* |
137 | * APIC command line parameters | 141 | * APIC command line parameters |
138 | */ | 142 | */ |
@@ -162,8 +166,7 @@ int x2apic_mode; | |||
162 | /* x2apic enabled before OS handover */ | 166 | /* x2apic enabled before OS handover */ |
163 | int x2apic_preenabled; | 167 | int x2apic_preenabled; |
164 | static int x2apic_disabled; | 168 | static int x2apic_disabled; |
165 | static int nox2apic; | 169 | static int __init setup_nox2apic(char *str) |
166 | static __init int setup_nox2apic(char *str) | ||
167 | { | 170 | { |
168 | if (x2apic_enabled()) { | 171 | if (x2apic_enabled()) { |
169 | int apicid = native_apic_msr_read(APIC_ID); | 172 | int apicid = native_apic_msr_read(APIC_ID); |
@@ -178,7 +181,7 @@ static __init int setup_nox2apic(char *str) | |||
178 | } else | 181 | } else |
179 | setup_clear_cpu_cap(X86_FEATURE_X2APIC); | 182 | setup_clear_cpu_cap(X86_FEATURE_X2APIC); |
180 | 183 | ||
181 | nox2apic = 1; | 184 | nox2apic = true; |
182 | 185 | ||
183 | return 0; | 186 | return 0; |
184 | } | 187 | } |