Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 02 Jul 2018 16:25:34 -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 1fa1ds-0006tI-9V for speck@linutronix.de; Mon, 02 Jul 2018 18:25:32 +0200 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 757C9AFC6 for ; Mon, 2 Jul 2018 16:25:26 +0000 (UTC) Date: Mon, 2 Jul 2018 18:25:18 +0200 From: Borislav Petkov Subject: [MODERATED] Re: [patch V5 01/10] KVM magic # 1 Message-ID: <20180702162518.GB27541@zn.tnic> References: <20180702154426.910579106@linutronix.de> <20180702160528.567252129@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20180702160528.567252129@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Mon, Jul 02, 2018 at 05:44:27PM +0200, speck for Thomas Gleixner wrote: > From: Konrad Rzeszutek Wilk konrad.wilk@oracle.com >=20 > commit 75e236a35266617b8c80ec3f5f98f6c81e326c5b upstream You probably don't want that here. > If the L1TF CPU bug is present we allow the KVM module to be loaded > as the major of users that use Linux and KVM have trusted guests > and do not want a broken setup. >=20 > Cloud vendors are the ones that are uncomfortable with CVE 2018-3615 > and as such they are the ones that should set disallow_smt to one. >=20 > Setting disallow_smt to means that the system administrator also needs In both occurrences above: s/disallow_smt/nosmt/ too. > to disable SMT (Hyper-threading) in the BIOS, or via the 'nosmt' command > line parameter, or via the /sys/devices/system/cpu/smt/control > (see commit 05736e4ac13c cpu/hotplug: Provide knobs to control SMT). >=20 > Other mitigations are to use task affinity, cpu sets, interrupt binding, > etc - anything to make sure that _only_ the same guests vCPUs are running > on sibling threads. >=20 > Signed-off-by: Konrad Rzeszutek Wilk > --- > v3:-Move it to vmx_vcpu_init (could also do it in kvm_vcpu_init but it seem= ed > more prudent to do it in VMX handler. > -Made it WARN if disallow_smt=3D0 > -Made it ERR if disallow_smt=3D1 > -Fixed the CVE number > v4: s/disallow/nosmt/ >=20 > --- > Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ > arch/x86/kvm/vmx.c | 13 +++++++++++++ > kernel/cpu.c | 1 + > 3 files changed, 20 insertions(+) >=20 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -1946,6 +1946,12 @@ > [KVM,ARM] Allow use of GICv4 for direct injection of > LPIs. > =20 > + kvm-intel.nosmt=3D[KVM,Intel] If the L1TF CPU bug is present (CVE-2018-36= 20) > + and the system has SMT (aka Hyper-Threading) enabled then > + don't allow guests to be created. > + > + Default is 0 (allow guests to be created). > + > kvm-intel.ept=3D [KVM,Intel] Disable extended page tables > (virtualized MMU) support on capable Intel chips. > Default is 1 (enabled) > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -71,6 +71,9 @@ static const struct x86_cpu_id vmx_cpu_i > }; > MODULE_DEVICE_TABLE(x86cpu, vmx_cpu_id); > =20 > +static bool __read_mostly nosmt =3D false; As already mentioned on IRC: quilt refresh :) --=20 Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, HR= B 21284 (AG N=C3=BCrnberg) --=20