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 ; 22 Jan 2019 01:16:42 -0000 Received: from mga07.intel.com ([134.134.136.100]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1glkgC-0001XU-OH for speck@linutronix.de; Tue, 22 Jan 2019 02:16:41 +0100 Date: Mon, 21 Jan 2019 17:16:37 -0800 From: Andi Kleen Subject: [MODERATED] Re: [PATCH v5 06/27] MDSv5 18 Message-ID: <20190122011637.GR6118@tassilo.jf.intel.com> References: <20190121224150.dhy6hagloqgsxajv@treble> MIME-Version: 1.0 In-Reply-To: <20190121224150.dhy6hagloqgsxajv@treble> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, Jan 21, 2019 at 04:41:50PM -0600, speck for Josh Poimboeuf wrote: > On Fri, Jan 18, 2019 at 04:50:21PM -0800, speck for Andi Kleen wrote: > > --- a/arch/x86/include/asm/clearcpu.h > > +++ b/arch/x86/include/asm/clearcpu.h > > @@ -20,6 +20,26 @@ static inline void clear_cpu(void) > > [kernelds] "m" (kernel_ds)); > > } > > > > +/* > > + * Clear CPU buffers before going idle, so that no state is leaked to SMT > > + * siblings taking over thread resources. > > + * Out of line to avoid include hell. > > + * > > + * Assumes that interrupts are disabled and only get reenabled > > + * before idle, otherwise the data from a racing interrupt might not > > + * get cleared. There are some callers who violate this, > > + * but they are only used in unattackable cases, like CPU > > + * offlining. > > + */ > > + > > +static inline void clear_cpu_idle(void) > > +{ > > + if (sched_smt_active()) { > > + clear_thread_flag(TIF_CLEAR_CPU); > > + clear_cpu(); > > + } > > +} > > + > > DECLARE_STATIC_KEY_FALSE(force_cpu_clear); > > This causes an error with CONFIG_ACPI_PROCESSOR_AGGREGATOR: > > ERROR: "sched_smt_present" [drivers/acpi/acpi_pad.ko] undefined! > > because sched_smt_present isn't exported. Yes it's a regression from the previous version. Just readd the hunk below. I'll do so in the next version. > > > diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c > > index b2131c4ea124..b4406ca1dfd7 100644 > > --- a/drivers/acpi/processor_idle.c > > +++ b/drivers/acpi/processor_idle.c > > @@ -33,6 +33,7 @@ > > #include > > #include > > #include > > +#include > > This should be s/asm/linux/ because this code can be used by non-x86 > arches. Ok. -Andi diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b8cb9aad6b74..b9d2a617b105 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5982,6 +5982,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p #ifdef CONFIG_SCHED_SMT DEFINE_STATIC_KEY_FALSE(sched_smt_present); +EXPORT_SYMBOL(sched_smt_present); static inline void set_idle_cores(int cpu, int val) {