From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Poimboeuf Subject: [PATCH RFC 0/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options Date: Thu, 4 Apr 2019 11:44:10 -0500 Message-ID: Return-path: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-arch.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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Josh Poimboeuf Subject: [PATCH RFC 0/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options Date: Thu, 4 Apr 2019 11:44:10 -0500 Message-ID: Sender: linux-arch-owner@vger.kernel.org List-ID: 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 Message-ID: <20190404164410.FyWPYQnV_AC5qVM5C3Jcx1ysIg_8piJ6yY46gIDHjZU@z> 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