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 ; 06 Mar 2019 14:42:58 -0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1h1Xl2-0005ue-9Q for speck@linutronix.de; Wed, 06 Mar 2019 15:42:56 +0100 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2CCB8BAD8 for ; Wed, 6 Mar 2019 14:42:50 +0000 (UTC) Date: Wed, 6 Mar 2019 15:42:46 +0100 From: Borislav Petkov Subject: [MODERATED] Re: [patch V6 12/14] MDS basics 12 Message-ID: <20190306144246.GG21338@zn.tnic> References: <20190301214738.281554861@linutronix.de> <20190301214848.253554490@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20190301214848.253554490@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Fri, Mar 01, 2019 at 10:47:50PM +0100, speck for Thomas Gleixner wrote: > Subject: [patch V6 12/14] x86/speculation/mds: Add mitigation mode VMWERV > From: Thomas Gleixner >=20 > In virtualized environments it can happen that the host has the microcode > update which utilizes the VERW instruction to clear CPU buffers, but the > hypervisor is not yet updated to expose the X86_FEATURE_MD_CLEAR CPUID bit > to guests. >=20 > Introduce an internal mitigation mode VWWERV which enables the invocation > of the CPU buffer clearing even if X86_FEATURE_MD_CLEAR is not set. If the > system has no updated microcode this results in a pointless execution of > the VERW instruction wasting a few CPU cycles. If the microcode is updated, > but not exposed to a guest then the CPU buffers will be cleared. >=20 > That said: Virtual Machines Will Eventually Receive Vaccine >=20 > Signed-off-by: Thomas Gleixner > --- > V2 -> V3: Rename mode. > --- > Documentation/x86/mds.rst | 27 +++++++++++++++++++++++++++ > arch/x86/include/asm/processor.h | 1 + > arch/x86/kernel/cpu/bugs.c | 18 ++++++++++++------ > 3 files changed, 40 insertions(+), 6 deletions(-) ... > @@ -235,10 +236,9 @@ static void mds_select_mitigation(void) > } > =20 > if (mds_mitigation =3D=3D MDS_MITIGATION_FULL) { > - if (boot_cpu_has(X86_FEATURE_MD_CLEAR)) > - static_branch_enable(&mds_user_clear); > - else > - mds_mitigation =3D MDS_MITIGATION_OFF; > + if (!boot_cpu_has(X86_FEATURE_MD_CLEAR)) > + mds_mitigation =3D MDS_MITIGATION_VMWERV; > + static_branch_enable(&mds_user_clear); > } > pr_info("%s\n", mds_strings[mds_mitigation]); > } > @@ -703,8 +703,14 @@ void arch_smt_update(void) > break; > } > =20 > - if (mds_mitigation =3D=3D MDS_MITIGATION_FULL) > + switch(mds_mitigation) { ERROR: space required before the open parenthesis '(' #119: FILE: arch/x86/kernel/cpu/bugs.c:706: + switch(mds_mitigation) { with that addressed: Reviewed-by: Borislav Petkov --=20 Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, HR= B 21284 (AG N=C3=BCrnberg) --=20