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 56BAEC433EF for ; Thu, 28 Oct 2021 19:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33683610FD for ; Thu, 28 Oct 2021 19:34:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbhJ1ThL (ORCPT ); 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. 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 3B235C433EF for ; Thu, 28 Oct 2021 19:36:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE7CC610FC for ; Thu, 28 Oct 2021 19:36:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EE7CC610FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UoLCCTJYaJ/GhNJAJvjvp6C6AYUbLSB15URUueBvswM=; b=2VXTAN0O7FeMqbZMQ+/5dkFqo/ cDIDnZwPk+vFaIrW+d0G0RoHiuygBnsXJa24Zbh88EQwVAVna0KJiLwE8DC0uP+ojNlHPlxzXI8at o0jJzX4l4+bKQCaDJjZivIZjJu6MZMO5o0O/GXF3ziVMR9rrqkiPblgxymlokbtPNOdT/gN2xkJdo 0Z7cYQyYDnD0/SZiuQ4NvNgnn7fyHX0ZsMUdxK0HdhLpPgNHgz6VAAfGOn770f1KeHoYN6/vjd1u+ Yq67xkrjcxgRmoi1qSdVcc46tnxsukrqO+9j7G772lH+cM2JnqLLAnnJ8kQIXPY529WfADAYFcB9L yHBtkOmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgBAo-008zJd-IP; Thu, 28 Oct 2021 19:34:50 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgBAk-008zHz-GV for linux-arm-kernel@lists.infradead.org; Thu, 28 Oct 2021 19:34:47 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10151"; a="230353862" X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="230353862" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 12:34:42 -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-Disposition: inline In-Reply-To: <20211028134918.GB48435@lakrids.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_123446_625046_FAF32C00 X-CRM114-Status: GOOD ( 14.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel