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 08:44:16 -0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fhWRy-0003VF-KS for speck@linutronix.de; Mon, 23 Jul 2018 10:44:15 +0200 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhWRw-0001fb-Rr for speck@linutronix.de; Mon, 23 Jul 2018 08:44:13 +0000 Date: Mon, 23 Jul 2018 10:44:10 +0200 From: Peter Zijlstra Subject: [MODERATED] Re: BUG: disabling SMT from BIOS Message-ID: <20180723084410.GY2494@hirez.programming.kicks-ass.net> References: <20180722220201.usehg7du4krlmmvf@treble> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: 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 :-)