Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 23 Jul 2018 12:46:03 -0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fhaDx-0000An-MF for speck@linutronix.de; Mon, 23 Jul 2018 14:46:02 +0200 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2C74402346D for ; Mon, 23 Jul 2018 12:45:54 +0000 (UTC) Received: from treble (ovpn-122-154.rdu2.redhat.com [10.10.122.154]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ADF982156892 for ; Mon, 23 Jul 2018 12:45:54 +0000 (UTC) Date: Mon, 23 Jul 2018 07:45:53 -0500 From: Josh Poimboeuf Subject: [MODERATED] Re: BUG: disabling SMT from BIOS Message-ID: <20180723124553.btzfagzsnoxoouhz@treble> References: <20180722220201.usehg7du4krlmmvf@treble> <20180723084410.GY2494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 In-Reply-To: <20180723084410.GY2494@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, Jul 23, 2018 at 10:44:10AM +0200, speck for Peter Zijlstra wrote: > On Mon, Jul 23, 2018 at 10:06:45AM +0200, speck for Jiri Kosina wrote: > > On Sun, 22 Jul 2018, speck for Josh Poimboeuf wrote: > > > > > When SMT is disabled from BIOS, sysfs confusingly reports that SMT is > > > enabled: > > > > > > $ cat /sys/devices/system/cpu/smt/control > > > on > > > > > > And it allows turning it 'off' and 'on', though those don't seem to have > > > any effect. (Though at least the 'active' file always shows '0'.) > > > > > > And the 'l1tf' file reports that SMT is vulnerable: > > > > > > $ cat /sys/devices/system/cpu/vulnerabilities/l1tf > > > Mitigation: PTE Inversion; VMX: SMT vulnerable, L1D conditional cache flushes > > > > > > which is obviously incorrect. > > > > I might not have time to test this properly today, but I think this should > > cure it, right? > > Yes that looks about right, smp_num_siblings is the max number of > siblings the CPUID topology information _can_ tell is about. > topology_max_smt_threads() is howver many we've actually seen during > enumeration. > > If someone could confirm, I'll see if I can work this magic Thomas left > me :-) NACK, this permanently disables SMT on my system, regardless of the BIOS settings. I suspect it needs to be called later, after the other CPUs have been brought online. -- Josh