Message ID | 20211021122112.592634-2-namit@vmware.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/mprotect: avoid unnecessary TLB flushes | expand |
On 10/21/21 5:21 AM, Nadav Amit wrote: > --- a/arch/x86/kernel/cpu/intel.c > +++ b/arch/x86/kernel/cpu/intel.c > @@ -296,6 +296,11 @@ static void early_init_intel(struct cpuinfo_x86 *c) > } > } > > + if (c->x86_model == 87) { > + pr_info_once("Enabling PTE leaking workaround\n"); > + set_cpu_bug(c, X86_BUG_PTE_LEAK); > + } Please take a look at: arch/x86/include/asm/intel-family.h specifically: #define INTEL_FAM6_XEON_PHI_KNL 0x57 /* Knights Landing */
> On Oct 26, 2021, at 8:54 AM, Dave Hansen <dave.hansen@intel.com> wrote: > > On 10/21/21 5:21 AM, Nadav Amit wrote: >> --- a/arch/x86/kernel/cpu/intel.c >> +++ b/arch/x86/kernel/cpu/intel.c >> @@ -296,6 +296,11 @@ static void early_init_intel(struct cpuinfo_x86 *c) >> } >> } >> >> + if (c->x86_model == 87) { >> + pr_info_once("Enabling PTE leaking workaround\n"); >> + set_cpu_bug(c, X86_BUG_PTE_LEAK); >> + } > > Please take a look at: > > arch/x86/include/asm/intel-family.h > > specifically: > > #define INTEL_FAM6_XEON_PHI_KNL 0x57 /* Knights Landing */ Thanks, I will fix it. I really just copy pasted from Andi’s patch (for better and worse).
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index d0ce5cfd3ac1..32d0aabd788d 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -436,5 +436,6 @@ #define X86_BUG_TAA X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */ #define X86_BUG_ITLB_MULTIHIT X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */ #define X86_BUG_SRBDS X86_BUG(24) /* CPU may leak RNG bits if not mitigated */ +#define X86_BUG_PTE_LEAK X86_BUG(25) /* PTE may leak A/D bits after clear */ #endif /* _ASM_X86_CPUFEATURES_H */ diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 8321c43554a1..40bcba6e3641 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -296,6 +296,11 @@ static void early_init_intel(struct cpuinfo_x86 *c) } } + if (c->x86_model == 87) { + pr_info_once("Enabling PTE leaking workaround\n"); + set_cpu_bug(c, X86_BUG_PTE_LEAK); + } + /* * Intel Quark Core DevMan_001.pdf section 6.4.11 * "The operating system also is required to invalidate (i.e., flush)