Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1920794pxb; Thu, 28 Oct 2021 12:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLustF52cDbn8EvaQuqizQ957YJxPLuLO9TcWE6BoDT5HMtrkVWlvjFh1wAGkw8Oy4EaH6 X-Received: by 2002:a05:6a00:851:b0:47c:990:9fe0 with SMTP id q17-20020a056a00085100b0047c09909fe0mr6153322pfk.20.1635449789752; Thu, 28 Oct 2021 12:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635449789; cv=none; d=google.com; s=arc-20160816; b=MmwA8drCFxkCkH/SP1ooJ7D78x7wy9CO5j6SMj8/nNEUqAhSp46x92XCVQ5OA9rokb reIg3O4SU3fRUXBALSNg8VQnRD+jN1Y+qeL2tdtpZD73Zo9enTiqQm2AhGu3nFAjJZWJ RHApIFv+h8CE2+PD9nHdaNV1hCeaNjMIOtJvcxy+b8UHJr/HW3CZJyFcDF+2qvdHWDuL ekgHBfY3UmuS5CIMFrOh2fGRi19JGj5jw9zosFdDqjxbugX5w87pkDXyqGEgoxmbmIIc WQh8iWwZcaM/FZu/L+daAXSUVO5SoqOW+x8c3IbYpOUUycmNaAYgInHDtjPVuhKb9/xX CsHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Ve8ORIPpsWV0reg1eUKsBRgURDjnf7/NngA8DYI+wIo=; b=eeayupF4as8vW35MM782O4G8SSAqikx5KLbNtjqSU8CoNGtcBm7f5ozldcSRSdAtzD EfDdtzmlA/gEMZ6PnWzWc0+NnKJkMOc6VzO6EOxrmxOI58ZrkI+9bkyEQKcsYP/nzYDW jz0ZYhCTOHvodsg5F3Ok0s8NJSp29DOLIRWZg/El+kIeJvb7+CsqkyH7NhM1axaixSBV wugbxQJw7gAFeB5Czb+GjqF23zYrqn2mjlGZ9faQB8R9TsGT1gYPdI3olkoJ0tFw9woJ CEjvcrkAY4FDG3d65d0niMsQgH3qMIg1u/MqhJsI3jEaCR4a536QreVAWu2idOzXdLdg /K1Q== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si5166005pgm.349.2021.10.28.12.36.16; Thu, 28 Oct 2021 12:36:29 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231158AbhJ1ThL (ORCPT + 99 others); Thu, 28 Oct 2021 15:37:11 -0400 Received: from mga07.intel.com ([134.134.136.100]:11785 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbhJ1ThJ (ORCPT ); Thu, 28 Oct 2021 15:37:09 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10151"; a="293958002" X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="293958002" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 12:34:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="498541872" Received: from gupta-dev2.jf.intel.com (HELO gupta-dev2.localdomain) ([10.54.74.119]) by orsmga008.jf.intel.com with ESMTP; 28 Oct 2021 12:34:41 -0700 Date: Thu, 28 Oct 2021 12:36:58 -0700 From: Pawan Gupta To: Mark Rutland 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, Alexei Starovoitov , Daniel Borkmann , bpf@vger.kernel.org Subject: Re: [PATCH v2 1/2] arch/Kconfig: Make CONFIG_CPU_SPECTRE available for all architectures Message-ID: <20211028193658.7n2oehp6yogyqbwq@gupta-dev2.localdomain> References: <232b692cd79e4f6e4c3ee7055b5f02792a28d2c4.1635383031.git.pawan.kumar.gupta@linux.intel.com> <20211028134918.GB48435@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20211028134918.GB48435@lakrids.cambridge.arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.10.2021 14:49, Mark Rutland wrote: >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. Isn't ARM already using CPU_SPECTRE for selecting things: config HARDEN_BRANCH_PREDICTOR bool "Harden the branch predictor against aliasing attacks" if EXPERT depends on CPU_SPECTRE This was the whole motivation for doing the same for x86. Adding a condition for all architectures is also okay, but its going to a little messier: config BPF_UNPRIV_DEFAULT_OFF default y if X86 || ARM || ... This approach would make sense if architectures wants to explicitly select the defaults irrespective of architecture being affected by spectre. If that's the case I will change the BPF_UNPRIV_DEFAULT_OFF default to depend on architecture. I hope BPF maintainer, Daniel is okay with it? Pawan Added BPF maintainers and bpf@vger to cc.