From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16310C433FE for ; Thu, 28 Oct 2021 13:49:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0084B61056 for ; Thu, 28 Oct 2021 13:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231139AbhJ1NwI (ORCPT ); Thu, 28 Oct 2021 09:52:08 -0400 Received: from foss.arm.com ([217.140.110.172]:55180 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230445AbhJ1Nvv (ORCPT ); Thu, 28 Oct 2021 09:51:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DBF7C13A1; Thu, 28 Oct 2021 06:49:23 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C61E43F70D; Thu, 28 Oct 2021 06:49:20 -0700 (PDT) Date: Thu, 28 Oct 2021 14:49:18 +0100 From: Mark Rutland To: Pawan Gupta Cc: Russell King , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook , Andrew Morton , Masahiro Yamada , "Peter Zijlstra (Intel)" , Sami Tolvanen , Colin Ian King , Frederic Weisbecker , Mike Rapoport , YiFei Zhu , "Steven Rostedt (VMware)" , Viresh Kumar , Andrey Konovalov , Wang Kefeng , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/2] arch/Kconfig: Make CONFIG_CPU_SPECTRE available for all architectures Message-ID: <20211028134918.GB48435@lakrids.cambridge.arm.com> References: <232b692cd79e4f6e4c3ee7055b5f02792a28d2c4.1635383031.git.pawan.kumar.gupta@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <232b692cd79e4f6e4c3ee7055b5f02792a28d2c4.1635383031.git.pawan.kumar.gupta@linux.intel.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 06:33:22PM -0700, Pawan Gupta wrote: > Borrow CONFIG_CPU_SPECTRE from ARM to be available for all > architectures. This will help in configuration of features that depend > on CPU being affected by spectre class of vulnerabilities. > > Signed-off-by: Pawan Gupta Given that spectre isn't one specific issue, biut rather a blanket term for a bunch of things that can have variable overlap, I don't think this makes much sense unless we're going to add finer-grained options for all the variants, and IMO it'd make more sene for the architectures to directly select the things that'd otherwise be dependent on this. Thanks, Mark. > --- > arch/Kconfig | 3 +++ > arch/arm/mm/Kconfig | 3 --- > arch/x86/Kconfig | 1 + > 3 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 8df1c7102643..6aa856d51cb7 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -1091,6 +1091,9 @@ config ARCH_SUPPORTS_RT > config CPU_NO_EFFICIENT_FFS > def_bool n > > +config CPU_SPECTRE > + bool > + > config HAVE_ARCH_VMAP_STACK > def_bool n > help > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig > index 8355c3895894..44551465fd03 100644 > --- a/arch/arm/mm/Kconfig > +++ b/arch/arm/mm/Kconfig > @@ -828,9 +828,6 @@ config CPU_BPREDICT_DISABLE > help > Say Y here to disable branch prediction. If unsure, say N. > > -config CPU_SPECTRE > - bool > - > config HARDEN_BRANCH_PREDICTOR > bool "Harden the branch predictor against aliasing attacks" if EXPERT > depends on CPU_SPECTRE > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index d9830e7e1060..769739da67c6 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -124,6 +124,7 @@ config X86 > select CLKEVT_I8253 > select CLOCKSOURCE_VALIDATE_LAST_CYCLE > select CLOCKSOURCE_WATCHDOG > + select CPU_SPECTRE > select DCACHE_WORD_ACCESS > select EDAC_ATOMIC_SCRUB > select EDAC_SUPPORT > -- > 2.31.1 >