From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 23 Oct 2019 01:39:37 -0000 Received: from mga03.intel.com ([134.134.136.65]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iN5cd-0001UQ-0H for speck@linutronix.de; Wed, 23 Oct 2019 03:39:36 +0200 Date: Tue, 22 Oct 2019 18:33:21 -0700 From: Pawan Gupta Subject: [MODERATED] Re: [PATCH v7 04/10] TAAv7 4 Message-ID: <20191023013321.GC30440@guptapadev.amr> References: <20191022165112.GK31458@zn.tnic> MIME-Version: 1.0 In-Reply-To: <20191022165112.GK31458@zn.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Tue, Oct 22, 2019 at 06:51:12PM +0200, speck for Borislav Petkov wrote: > > +static void __init taa_select_mitigation(void) > > +{ > > + u64 ia32_cap = x86_read_arch_cap_msr(); > > Do that MSR access... > > > + > > + if (!boot_cpu_has_bug(X86_BUG_TAA)) { > > + taa_mitigation = TAA_MITIGATION_OFF; > > + return; > > + } > > ... here. > Is it okay to move x86_read_arch_cap_msr() further down just before its needed? + ia32_cap = x86_read_arch_cap_msr(); + if ((ia32_cap & ARCH_CAP_MDS_NO) && !(ia32_cap & ARCH_CAP_TSX_CTRL_MSR)) taa_mitigation = TAA_MITIGATION_UCODE_NEEDED; Thanks, Pawan