]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.176/0076-x86-cpu-bugs-Use-__initconst-for-const-init-data.patch
Linux 4.9.176
[thirdparty/kernel/stable-queue.git] / releases / 4.9.176 / 0076-x86-cpu-bugs-Use-__initconst-for-const-init-data.patch
1 From 96a89da58d7958c782492fdebc3da62dc6576b39 Mon Sep 17 00:00:00 2001
2 From: Andi Kleen <ak@linux.intel.com>
3 Date: Fri, 29 Mar 2019 17:47:43 -0700
4 Subject: [PATCH 76/76] x86/cpu/bugs: Use __initconst for 'const' init data
5
6 commit 1de7edbb59c8f1b46071f66c5c97b8a59569eb51 upstream.
7
8 Some of the recently added const tables use __initdata which causes section
9 attribute conflicts.
10
11 Use __initconst instead.
12
13 Fixes: fa1202ef2243 ("x86/speculation: Add command line control")
14 Signed-off-by: Andi Kleen <ak@linux.intel.com>
15 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 Link: https://lkml.kernel.org/r/20190330004743.29541-9-andi@firstfloor.org
17 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 arch/x86/kernel/cpu/bugs.c | 6 +++---
21 1 file changed, 3 insertions(+), 3 deletions(-)
22
23 diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
24 index 6eef57e83af7..16970c39baea 100644
25 --- a/arch/x86/kernel/cpu/bugs.c
26 +++ b/arch/x86/kernel/cpu/bugs.c
27 @@ -338,7 +338,7 @@ static const struct {
28 const char *option;
29 enum spectre_v2_user_cmd cmd;
30 bool secure;
31 -} v2_user_options[] __initdata = {
32 +} v2_user_options[] __initconst = {
33 { "auto", SPECTRE_V2_USER_CMD_AUTO, false },
34 { "off", SPECTRE_V2_USER_CMD_NONE, false },
35 { "on", SPECTRE_V2_USER_CMD_FORCE, true },
36 @@ -475,7 +475,7 @@ static const struct {
37 const char *option;
38 enum spectre_v2_mitigation_cmd cmd;
39 bool secure;
40 -} mitigation_options[] __initdata = {
41 +} mitigation_options[] __initconst = {
42 { "off", SPECTRE_V2_CMD_NONE, false },
43 { "on", SPECTRE_V2_CMD_FORCE, true },
44 { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false },
45 @@ -752,7 +752,7 @@ static const char * const ssb_strings[] = {
46 static const struct {
47 const char *option;
48 enum ssb_mitigation_cmd cmd;
49 -} ssb_mitigation_options[] __initdata = {
50 +} ssb_mitigation_options[] __initconst = {
51 { "auto", SPEC_STORE_BYPASS_CMD_AUTO }, /* Platform decides */
52 { "on", SPEC_STORE_BYPASS_CMD_ON }, /* Disable Speculative Store Bypass */
53 { "off", SPEC_STORE_BYPASS_CMD_NONE }, /* Don't touch Speculative Store Bypass */
54 --
55 2.21.0
56