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 050A4C433F5 for ; Fri, 29 Oct 2021 10:09:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB19161184 for ; Fri, 29 Oct 2021 10:09:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbhJ2KLo (ORCPT ); Fri, 29 Oct 2021 06:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231564AbhJ2KLn (ORCPT ); Fri, 29 Oct 2021 06:11:43 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64E6CC061570; Fri, 29 Oct 2021 03:09:15 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211028193658.7n2oehp6yogyqbwq@gupta-dev2.localdomain> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.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!