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 6D732C433F5 for ; Fri, 29 Oct 2021 10:10:57 +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 2AECA610E5 for ; Fri, 29 Oct 2021 10:10:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2AECA610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk 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-Transfer-Encoding:Content-Type: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=3EXE2X01Spv0e+DUYOM55SgAq1FikHNyZqX6iuPKkKI=; b=ivG7YHKRfy75gb WoO57sY8H9yCayerN0LuDHp1hwtSId17iyXVIsF1B+ypRPo5XbGY79nZoyT+aFewyGjzPR+nOFM4+ ZF0tn09unSF+P7nS4AvwWr98W4RnXXFxH60drx0DKCjEgm+nWVO/SP2hcDqY+YUBdMtB2d+SDDSeR nofLIZ/WWrjWweSmnVCXbMYrU0SXmedwGXTKrsf01nw2mZ9mXXWwSmrrN+fUB2gdgLbw8l2dUBjyD d+9ZDOVixEbUeIeierfJ6hNJjV+0d8/96G+LVTXnO7vOAlad8PxEOGQrcpiu5BxIVaR47q1DxeWN6 zmaIyF/FKBZOsgcGjAgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgOp7-00AYvQ-5X; Fri, 29 Oct 2021 10:09:21 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgOp3-00AYuM-72 for linux-arm-kernel@lists.infradead.org; Fri, 29 Oct 2021 10:09:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ICtj6ogNyiHAyDVvU5WU0rRuxqqKqIKm4Rfph+OeZJI=; b=I2+F69JKN1g+B2lCz2qi+ZBdAz mcu/a60RI7RC6xmkiKqcChhPQRiKwIj0H0sNvSgwDNRMh0a/QlVo+Kni8FwOuAXPOehg9lzZYNZOr FHmp4uRSL62a7onzZsbZkaRBi/FhyjyatvHZFYbg3N+IzR6vnrlRxjvJyDQNCKOGSsaL1e2C5rAuG awSm1bd+Jx1i7T5iyAz9MaT551akL5h9suGc7W56mlQTsQHYRd8vYElvrpuGG5YPc8pLUPtWAbTfg ioYrClf4s73ZwTLuRgF0XeCjfzzUIfeqQ84Jl87pLlmU8qgTPK/0y5mzqO1xwvhDIo3BJJ8Br9DY/ NIDObfJA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55380) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mgOoV-0008UB-0L; Fri, 29 Oct 2021 11:08:43 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mgOoN-0001W3-TQ; Fri, 29 Oct 2021 11:08:35 +0100 Date: Fri, 29 Oct 2021 11:08:35 +0100 From: "Russell King (Oracle)" To: Pawan Gupta Cc: Mark Rutland , 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 =?iso-8859-1?Q?Kleine-K=F6nig?= , 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: References: <232b692cd79e4f6e4c3ee7055b5f02792a28d2c4.1635383031.git.pawan.kumar.gupta@linux.intel.com> <20211028134918.GB48435@lakrids.cambridge.arm.com> <20211028193658.7n2oehp6yogyqbwq@gupta-dev2.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211028193658.7n2oehp6yogyqbwq@gupta-dev2.localdomain> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_030917_268247_3400C337 X-CRM114-Status: GOOD ( 15.35 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 28, 2021 at 12:36:58PM -0700, Pawan Gupta wrote: > 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 || ... It doesn't have to be (but sadly we end up repeating "DEFAULT"): config BPF_UNPRIV_DEFAULT_OFF_DEFAULT bool config BPF_UNPRIV_DEFAULT_OFF bool "Disable unprivileged BPF by default" default BPF_UNPRIV_DEFAULT_OFF_DEFAULT Then architectures can select BPF_UNPRIV_DEFAULT_OFF_DEFAULT if they wish this to be defaulted to "yes". However, please note that this has limited use given that the BPF_UNPRIV_DEFAULT_OFF option has been around for a while now. Any existing configuration that mentions this symbol will override any default specified in the Kconfig files if the option is user-visible. So, IMHO, defaults need to be set correctly from the point in time that the option is introduced. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel