From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 12 Jun 2018 15:02:55 -0000 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fSkow-0008Vg-PT for speck@linutronix.de; Tue, 12 Jun 2018 17:02:54 +0200 Date: Tue, 12 Jun 2018 17:02:54 +0200 (CEST) From: Thomas Gleixner Subject: Re: [PATCH 5/8] L1TFv7 0 In-Reply-To: <20180607232537.C80D26114D@crypto-ml.lab.linutronix.de> Message-ID: References: <20180607232537.C80D26114D@crypto-ml.lab.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Thu, 7 Jun 2018, speck for ak_at_linux.intel.com wrote: > - We check for the (very unlikely) memory > MAX_PA/2 case That's not part of this patch. > Note this patch will likely conflict with some other workaround patches > floating around, but should be straight forward to fix. I don't see where this would conflict. > v2: Use positive instead of negative flag for WA. Fix override > reporting. > v3: Fix L1TF_WA flag settting > v4: Rebase to SSB tree > v5: Minor cleanups. No functional changes. > Don't mark atoms and knights as vulnerable > v6: Change _WA to _FIX > v7: Use common sysfs function Can you please put these version comments below the --- separator? It's annoying to have them in the changelog section itself as they are not going to end up in the git commit. > +static void __init l1tf_init_workaround(void) > +{ > +#if CONFIG_PGTABLE_LEVELS == 2 > + pr_warn("Kernel not compiled for PAE. No workaround for L1TF\n"); > +#else > + setup_force_cpu_cap(X86_FEATURE_L1TF_FIX); > +#endif > +} Why is this called from cpu_set_bug_bits()? That function merily sets the bug bits, but does not decide any mitigation strategy. That's done in check_bugs(). And if you do it there, then the issue with the forced feature bit does not exist either. > +static const __initconst struct x86_cpu_id cpu_no_l1tf[] = { > + /* in addition to cpu_no_speculation */ > + { X86_VENDOR_INTEL, 6, INTEL_FAM6_ATOM_SILVERMONT1 }, Please use consequently TABs not SPACE + TAB > + { X86_VENDOR_INTEL, 6, INTEL_FAM6_ATOM_SILVERMONT2 }, > diff --git a/include/linux/cpu.h b/include/linux/cpu.h > index a97a63eef59f..40305f3df548 100644 > --- a/include/linux/cpu.h > +++ b/include/linux/cpu.h > @@ -55,6 +55,8 @@ extern ssize_t cpu_show_spectre_v2(struct device *dev, > struct device_attribute *attr, char *buf); > extern ssize_t cpu_show_spec_store_bypass(struct device *dev, > struct device_attribute *attr, char *buf); > +extern ssize_t cpu_show_l1tf(struct device *dev, > + struct device_attribute *attr, char *buf); All other declarations have the second lines argument aligned with the first argument.... Thanks, tglx