Return-path: Received: from mx2.suse.de ([195.135.220.15]) by Galois.linutronix.de with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1f9oiO-0000aM-L2 for speck@linutronix.de; Sat, 21 Apr 2018 11:21:53 +0200 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C3169AD08 for ; Sat, 21 Apr 2018 09:21:45 +0000 (UTC) Date: Sat, 21 Apr 2018 11:21:39 +0200 From: Borislav Petkov Subject: [MODERATED] Re: [patch 06/11] [PATCH v2 06/10] Linux Patch #6 Message-ID: <20180421092139.GB18575@pd.tnic> References: <20180420022613.203909041@localhost.localdomain> MIME-Version: 1.0 In-Reply-To: <20180420022613.203909041@localhost.localdomain> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Thu, Apr 19, 2018 at 10:25:46PM -0400, speck for konrad.wilk_at_oracle.com= wrote: > +static void __init ssb_select_mitigation(void) > +{ > + enum ssb_mitigation_cmd cmd =3D ssb_parse_cmdline(); > + enum ssb_mitigation mode =3D SSB_NONE; > + > + if (!boot_cpu_has_bug(X86_BUG_CPU_SSB) && > + (cmd =3D=3D SSB_CMD_NONE || cmd =3D=3D SSB_CMD_AUTO)) > + return; > + > + switch (cmd) { > + case SSB_CMD_AUTO: > + case SSB_CMD_ON: > + mode =3D SSB_DISABLE; > + break; > + case SSB_CMD_NONE: > + break; > + } > + > + ssb_mode =3D mode; > + pr_info("%s\n", ssb_strings[mode]); > + > + if (mode =3D=3D SSB_NONE) > + setup_clear_cpu_cap(X86_FEATURE_MDD); So this logic doesn't work here: the fact that we disable the mitigation doesn't mean that the MDD feature is not there anymore - it is simply disabled. So you can't clear that bit. You need to define a synthetic X86_FEATURE_USE_MDD bit like the spectre stuff does define X86_FEATURE_USE_IBPB and X86_FEATURE_USE_IBRS_FW, for example, and test it whenever you want do to MDD. --=20 Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, HR= B 21284 (AG N=C3=BCrnberg) --=20