提交 66a782e5 编写于 作者: T Thomas Gleixner 提交者: Lin Wang

x86/fpu: Mark various FPU state variables __ro_after_init

mainline inclusion
from mainline-v5.14-rc1
commit ce578f16
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I590ZC
CVE: NA

Intel-SIG: commit ce578f16 x86/fpu: Mark various FPU state variables __ro_after_init.

--------------------------------

Nothing modifies these after booting.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Reviewed-by: NBorislav Petkov <bp@suse.de>
Reviewed-by: NAndy Lutomirski <luto@kernel.org>
Link: https://lkml.kernel.org/r/20210623121451.611751529@linutronix.deSigned-off-by: NLin Wang <lin.x.wang@intel.com>
上级 81e68102
...@@ -89,7 +89,7 @@ static void fpu__init_system_early_generic(struct cpuinfo_x86 *c) ...@@ -89,7 +89,7 @@ static void fpu__init_system_early_generic(struct cpuinfo_x86 *c)
/* /*
* Boot time FPU feature detection code: * Boot time FPU feature detection code:
*/ */
unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu; unsigned int mxcsr_feature_mask __ro_after_init = 0xffffffffu;
EXPORT_SYMBOL_GPL(mxcsr_feature_mask); EXPORT_SYMBOL_GPL(mxcsr_feature_mask);
static void __init fpu__init_system_mxcsr(void) static void __init fpu__init_system_mxcsr(void)
...@@ -135,7 +135,7 @@ static void __init fpu__init_system_generic(void) ...@@ -135,7 +135,7 @@ static void __init fpu__init_system_generic(void)
* This is inherent to the XSAVE architecture which puts all state * This is inherent to the XSAVE architecture which puts all state
* components into a single, continuous memory block: * components into a single, continuous memory block:
*/ */
unsigned int fpu_kernel_xstate_size; unsigned int fpu_kernel_xstate_size __ro_after_init;
EXPORT_SYMBOL_GPL(fpu_kernel_xstate_size); EXPORT_SYMBOL_GPL(fpu_kernel_xstate_size);
/* Get alignment of the TYPE. */ /* Get alignment of the TYPE. */
......
...@@ -61,17 +61,21 @@ static short xsave_cpuid_features[] __initdata = { ...@@ -61,17 +61,21 @@ static short xsave_cpuid_features[] __initdata = {
*/ */
u64 xfeatures_mask_all __read_mostly; u64 xfeatures_mask_all __read_mostly;
static unsigned int xstate_offsets[XFEATURE_MAX] = { [ 0 ... XFEATURE_MAX - 1] = -1}; static unsigned int xstate_offsets[XFEATURE_MAX] __ro_after_init =
static unsigned int xstate_sizes[XFEATURE_MAX] = { [ 0 ... XFEATURE_MAX - 1] = -1}; { [ 0 ... XFEATURE_MAX - 1] = -1};
static unsigned int xstate_comp_offsets[XFEATURE_MAX] = { [ 0 ... XFEATURE_MAX - 1] = -1}; static unsigned int xstate_sizes[XFEATURE_MAX] __ro_after_init =
static unsigned int xstate_supervisor_only_offsets[XFEATURE_MAX] = { [ 0 ... XFEATURE_MAX - 1] = -1}; { [ 0 ... XFEATURE_MAX - 1] = -1};
static unsigned int xstate_comp_offsets[XFEATURE_MAX] __ro_after_init =
{ [ 0 ... XFEATURE_MAX - 1] = -1};
static unsigned int xstate_supervisor_only_offsets[XFEATURE_MAX] __ro_after_init =
{ [ 0 ... XFEATURE_MAX - 1] = -1};
/* /*
* The XSAVE area of kernel can be in standard or compacted format; * The XSAVE area of kernel can be in standard or compacted format;
* it is always in standard format for user mode. This is the user * it is always in standard format for user mode. This is the user
* mode standard format size used for signal and ptrace frames. * mode standard format size used for signal and ptrace frames.
*/ */
unsigned int fpu_user_xstate_size; unsigned int fpu_user_xstate_size __ro_after_init;
/* /*
* Return whether the system supports a given xfeature. * Return whether the system supports a given xfeature.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册