summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/cacheinfo.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2022-11-02 10:47:00 +0300
committerBorislav Petkov <bp@suse.de>2022-11-10 15:12:44 +0300
commit45fa71f19a2d73f157d6892a8d677a738a0414fd (patch)
tree335ef71123f272e3bb55fc5dc9c61c09ff7eac4f /arch/x86/kernel/cpu/cacheinfo.c
parent7420ae3bb977b46eab082f4964641f3ddc98ebaf (diff)
downloadlinux-45fa71f19a2d73f157d6892a8d677a738a0414fd.tar.xz
x86/mtrr: Replace use_intel() with a local flag
In MTRR code use_intel() is only used in one source file, and the relevant use_intel_if member of struct mtrr_ops is set only in generic_mtrr_ops. Replace use_intel() with a single flag in cacheinfo.c which can be set when assigning generic_mtrr_ops to mtrr_if. This allows to drop use_intel_if from mtrr_ops, while preparing to decouple PAT from MTRR. As another preparation for the PAT/MTRR decoupling use a bit for MTRR control and one for PAT control. For now set both bits together, this can be changed later. As the new flag will be set only if mtrr_enabled is set, the test for mtrr_enabled can be dropped at some places. [ bp: Massage commit message. ] Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20221102074713.21493-4-jgross@suse.com Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'arch/x86/kernel/cpu/cacheinfo.c')
-rw-r--r--arch/x86/kernel/cpu/cacheinfo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
index 66556833d7af..32fb04920171 100644
--- a/arch/x86/kernel/cpu/cacheinfo.c
+++ b/arch/x86/kernel/cpu/cacheinfo.c
@@ -35,6 +35,9 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map);
/* Shared L2 cache maps */
DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_l2c_shared_map);
+/* Kernel controls MTRR and/or PAT MSRs. */
+unsigned int memory_caching_control __ro_after_init;
+
struct _cache_table {
unsigned char descriptor;
char cache_type;