Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1604285pxb; Thu, 28 Oct 2021 06:50:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8aMxljW5GQfaqcBbZXrpJ5d6jcmGBLuBgZoGxCgQQtQREXREsZ4g292hVoZqIieyUuz3f X-Received: by 2002:a63:924c:: with SMTP id s12mr3371355pgn.416.1635429055350; Thu, 28 Oct 2021 06:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635429055; cv=none; d=google.com; s=arc-20160816; b=bpYMuSI6UKbNSHWZCLN7VXM/DWNnvtgAl4Ig8YjCNpo2PK1ZTnl7Pn4mm05jv+OWC2 fNpUUZsu8T5eF7+SwrhYbfPokr5ZBzMR/4oiSYPmCuH1NU1ESMShlQqmaDFalPq7+A6V LqZbNQ9NofkayULQKnVGp33RHYQnDQFpFdGEatNxhss17IrIB2iOuXxgesFmTaeXOksC mkgWnpH6NkGKM/cFcj+hlinoAiH1XOMKS0yE3Zwn69Hfnrc54fPtk2ZyiaoNAIOg2ndT el46LvtXMTZ2fJKVfU5e2DXSPvH7WlvKtsP9QIndHWTG/JG4WA3fGI9DVwJC8Jt8QRwC rvPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=QdI2bjP8H+IBTE8+6Qv+widbwqXXo0GlT3p8GUcrg6g=; b=AL8QGVqfLsRsGwG/Gr2F8i1Njb0oikzkSbEDGsXn/rvYKJQUqrVFMSPiDuHkwWdQd+ BFJ8cWWJGFVMJTO0Dg046RNzjB7OTdPzXJL7xV5fkSNXb0SSgQk383qFVsIVxatYs+Uu 2eD3XAHwCPDnI3DVoCqvVyveWV4YO33xN4CbBJ1t5/S5Lj3QMekD7Ib1KASCLSh6Oln3 7oW6r1GciNP2uroXp21fYVetDdq7b3NJOx25aUagT7F3DL2vWnPUT4RiSQqBjeatnTFa de/F4N1G1Y49bMil5Cj3yCfLX/MayMN4cuFbNKwJTVTPpdjJrvxpKPCMjKHGadVVAJmw dZFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y68si4876587pgy.100.2021.10.28.06.50.41; Thu, 28 Oct 2021 06:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbhJ1NwG (ORCPT + 99 others); Thu, 28 Oct 2021 09:52:06 -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 >