Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1389532yba; Thu, 4 Apr 2019 09:46:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSJRl0hku2OJpEc49rLD5AqJzXWvlc0nlsBsWyxkVdNZMu4GU7c3JIqbTgL0s71yUiN9I2 X-Received: by 2002:a62:ed08:: with SMTP id u8mr6845078pfh.200.1554396366476; Thu, 04 Apr 2019 09:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554396366; cv=none; d=google.com; s=arc-20160816; b=k/8KFX7CO4Gf1olEY9NrmXwawSSDoorCH5GqLSIUhRlBGXyq4hs6Ku5Rf25QgvZ5gy of0RKJ9CpT11V6bEF6ShwTqpOp6Bmzhu7GuKK65JPJ8Gu1mA4lGcqgVwU/c2XoScyxWg 4f6Gah3z0XKaY3TDI5Ndywz9QVxwBPRYvzLh+Yor9te8DnpDqJzpP2x8x11KuE71QQ7x pV9dev8jxH/ceEbVP46Nnl5ay/AaEsX6zDWbXPOuMH6m3gyfx4MnPc69iXbfri0FeP+t S6BB4mMfajvO2aoTMjVMJuqOWGwh+rkHbNS5bH16ekdhTGQa+W4OMA1L8x1w0YSFVkoh HCPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=HXf14dIvBzITQVaHRQEc1fbcsk0Yx/nVVyo1mespLNk=; b=bwWdwDiuvPPGPpnuJyeFT+Wx9hoCIqjZSajoJvWxY9+4Cj1ux5XTVom6wgQkPqNwA+ 5pZWOnsXTH0PVsTKc8R9FAwZoXk5GHZxrEaZVX+Zqe/uw+eGKe2e/+mm/QuBXuQcV33i gAdFmpWMRtC8q4Ph9EJvcJh9dNL9DSpFtbr0rjwkc2ZdyyYhJaImue72tpZuBVxbhmRy TANE6WYCr4mu3FAAF/GvLy0j5IrM+sL4pKKEhYBhAEom4pAhnr1niAsMdF/cbbQRXccN qKXGzwUJ1z07HPf26i9PEhNpFwI7kyS1UT4htyvdE0Kw5tmjt4bB/QxYmOBNM3EXOMIB i68w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6si6225436pgs.518.2019.04.04.09.45.51; Thu, 04 Apr 2019 09:46:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729501AbfDDQpH (ORCPT + 99 others); Thu, 4 Apr 2019 12:45:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56880 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727353AbfDDQpH (ORCPT ); Thu, 4 Apr 2019 12:45:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED709308793A; Thu, 4 Apr 2019 16:45:05 +0000 (UTC) Received: from treble.redhat.com (ovpn-125-158.rdu2.redhat.com [10.10.125.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EFE2608BB; Thu, 4 Apr 2019 16:44:58 +0000 (UTC) From: Josh Poimboeuf To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Jiri Kosina , Waiman Long , Andrea Arcangeli , Jon Masters , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Greg Kroah-Hartman , Tyler Hicks , Linus Torvalds Subject: [PATCH RFC 0/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options Date: Thu, 4 Apr 2019 11:44:10 -0500 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 04 Apr 2019 16:45:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Keeping track of the number of mitigations for all the CPU speculation bugs has become overwhelming for many users. It's getting more and more complicated to decide which mitigations are needed for a given architecture. Complicating matters is the fact that each arch tends to it own custom way to mitigate the same vulnerability. Most users fall into a few basic categories: a) they want all CPU speculation mitigations off; b) they want all reasonable mitigations on, with SMT enabled even if it's vulnerable; or c) they want all reasonable mitigations on, with SMT disabled if vulnerable. Define a set of curated, arch-independent options, each of which is an aggregation of existing options: - cpu_spec_mitigations=off: Disable all mitigations. - cpu_spec_mitigations=auto: [default] Enable all the default mitigations, but leave SMT enabled, even if it's vulnerable. - cpu_spec_mitigations=auto,nosmt: Enable all the default mitigations, disabling SMT if needed by a mitigation. Josh Poimboeuf (5): cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline options powerpc/speculation: Add support for 'cpu_spec_mitigations=' cmdline options s390/speculation: Add support for 'cpu_spec_mitigations=' cmdline options arm64/speculation: Add support for 'cpu_spec_mitigations=' cmdline options .../admin-guide/kernel-parameters.txt | 42 +++++++++++++++++++ arch/arm64/kernel/cpu_errata.c | 4 ++ arch/arm64/kernel/cpufeature.c | 6 +++ arch/powerpc/kernel/security.c | 6 +-- arch/powerpc/kernel/setup_64.c | 2 +- arch/s390/kernel/nospec-branch.c | 4 +- arch/x86/include/asm/processor.h | 1 + arch/x86/kernel/cpu/bugs.c | 32 ++++++++++++-- arch/x86/kvm/vmx/vmx.c | 2 + arch/x86/mm/pti.c | 4 +- include/linux/cpu.h | 8 ++++ kernel/cpu.c | 15 +++++++ 12 files changed, 116 insertions(+), 10 deletions(-) -- 2.17.2