FAILED: patch "[PATCH] x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+" failed to apply to 4.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
cc51e5428ea54f575d49cfcede1d4cb3a72b4ec4Mon Sep 17 00:00:00 2001
From: Andi Kleen <[email protected]>
Date: Fri, 24 Aug 2018 10:03:50 -0700
Subject: [PATCH] x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+
On Nehalem and newer core CPUs the CPU cache internally uses 44 bits physical address space. The L1TF workaround is limited by this internal cache address width, and needs to have one bit free there for the mitigation to work.
Older client systems report only 36bit physical address space so the range check decides that L1TF is not mitigated for a 36bit phys/32GB system with some memory holes.
But since these actually have the larger internal cache width this warning is bogus because it would only really be needed if the system had more than 43bits of memory.
Add a new internal x86_cache_bits field. Normally it is the same as the physical bits field reported by CPUID, but for Nehalem and newerforce it to be at least 44bits.
Change the L1TF memory size warning to use the new cache_bits field to avoid bogus warnings and remove the bogus comment about memory size.
arch/x86/include/asm/processor.h +3 -1
@@ -132,6 +132,8 @@ struct cpuinfo_x86 {/* Index into per_cpu list: */ u16 cpu_index;u32 microcode; +/* Address space bits used by the cache internally */ +u8 x86_cache_bits; unsigned initialized : 1; } __randomize_layout;
@@ -183,7 +185,7 @@ extern void cpu_detect(struct cpuinfo_x86 *c);static inline unsigned long long l1tf_pfn_limit (void ) { -return BIT_ULL (boot_cpu_data.x86_phys_bits -1 -PAGE_SHIFT ); +return BIT_ULL (boot_cpu_data.x86_cache_bits -1 -PAGE_SHIFT ); }extern void early_cpu_init (void );
arch/x86/kernel/cpu/bugs.c +41 -5
64 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +1 -0
@@ -919,6 +919,7 @@ void get_cpu_address_sizes(struct cpuinfo_x86 *c) else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36)) c->x86_phys_bits = 36;#endif + c->x86_cache_bits = c->x86_phys_bits; }static void identify_cpu_without_cpuid (struct cpuinfo_x86 *c)