Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 11 Mar 2020 23:18:29 -0000 Received: from mga02.intel.com ([134.134.136.20]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jCAcL-0004UQ-MM for speck@linutronix.de; Thu, 12 Mar 2020 00:18:27 +0100 Received: from localhost (mtg-dev.jf.intel.com [10.54.74.10]) by smtp.ostc.intel.com (Postfix) with ESMTP id 007AC6367 for ; Wed, 11 Mar 2020 23:18:19 +0000 (UTC) Date: Wed, 11 Mar 2020 16:18:19 -0700 From: mark gross Subject: [MODERATED] Re: [PATCH 1/2] v3 more sampling fun 1 Message-ID: <20200311231819.GB78230@mtg-dev.jf.intel.com> Reply-To: mgross@linux.intel.com References: <7509b1c6-1324-5763-36b4-83d306da7979@citrix.com> MIME-Version: 1.0 In-Reply-To: <7509b1c6-1324-5763-36b4-83d306da7979@citrix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Wed, Mar 11, 2020 at 08:28:36PM +0000, speck for Andrew Cooper wrote: > On 16/01/2020 22:16, speck for mark gross wrote: > > +static void __init srbds_select_mitigation(void) > > +{ > > + u64 ia32_cap; > > + > > + if (!boot_cpu_has_bug(X86_BUG_SRBDS)) { > > + srbds_mitigation = SRBDS_NOT_AFFECTED; > > + return; > > + } > > + > > + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { > > + srbds_mitigation = SRBDS_HYPERVISOR; > > + return; > > + } > > These two ought to be reversing (and with a suitable adjustment to the > docs in patch 2). > > If you're running as a guest, you can't even trust the model number used > to divine X86_BUG_SRBDS in the first place. > I'll change this for the next version. --mark