Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp972769rwl; Fri, 24 Mar 2023 04:44:48 -0700 (PDT) X-Google-Smtp-Source: AKy350aUIy0f127vbWQBygOP+qxWRsZtvb3OnlZij3POJk9yUovyWTgUhtx7Y/d3D+dzPem33ZPB X-Received: by 2002:a17:906:2581:b0:87b:6bbb:11ac with SMTP id m1-20020a170906258100b0087b6bbb11acmr2067993ejb.60.1679658288057; Fri, 24 Mar 2023 04:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679658288; cv=none; d=google.com; s=arc-20160816; b=hDJRIPq3W6IHjOTb8uHD2EZLKQp+4OUKVKcD8uPzVNYrSL7Bexk2jHDn7qVu7bbHmB nv2Ra1sp2RXsnl96Yq4KG9T8LHFYDSfKi9tMtjKUW/sZwofMpTv8nq5gjVDPBmB9KrOz YrUIWtRxksbhdPltdgBkPj5VmfsIJzggbQglpWp6KfUunf/ZfqpLmTyGZ9LWcEoVR24n xjQsOjfV1XVNQIAScODDtjIbVgLRnMplycSDrDnvgAVJ7EsYy6w4GTtvMzQItyMRd9Bl X57Hgq0VNlYycTpM0rqJP+LWnG+0GUkgVrfKU0ODJktR59E2Kfxije1hMlVZUPPr+wFg xGqg== 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:dkim-signature; bh=cEeRHO/zUWvbMymxotAYrIHIcsBog8Q80jrMbSXh8GA=; b=sV4pYhRkIj9TPAe3ygiAzBZTYrP9sIWnqCPM1P4mwFT1iypAlKdM8ee1iTlVqfUbx5 aIPedPr9l0/HCvwjIJgAfAyDGli1rBbPTfcDmU+zSRPUuODLAZ4MnDT5WkFZVT9LCHNE /I/RoGeco4BF1XXCREndXVf7nzU1PPWQYzevpLMauNXtl6a7qA5ZzrnevoEpDvF7LNiY uIzbObeytJ/LIwDSybhNUQnRh1UgU0df8OjaE7pmRVK2cHgbZQB7qlWeuOmj0U/5wWm2 uvxlinHiq7lADn7R8u2OBDkW+qWJZEj09vY5kI4Op8zR7EOaANqQeYOTwaTGweYLj9Zr Baow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jtZSsoPS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kg3-20020a17090776e300b00930894e4fa9si19588008ejc.324.2023.03.24.04.44.23; Fri, 24 Mar 2023 04:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jtZSsoPS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231460AbjCXLnR (ORCPT + 99 others); Fri, 24 Mar 2023 07:43:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbjCXLnP (ORCPT ); Fri, 24 Mar 2023 07:43:15 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DAB81EBC1 for ; Fri, 24 Mar 2023 04:43:14 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id i9so1501136wrp.3 for ; Fri, 24 Mar 2023 04:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1679658193; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cEeRHO/zUWvbMymxotAYrIHIcsBog8Q80jrMbSXh8GA=; b=jtZSsoPSziKeFSqWmKe4UJGQbP8HAsz9FRaV1wjqLkOnMX2Bz2PLVjuVjktfcNUGwN fwU4JI0qlVBfYSZhRQ4MQ3gPyLkRZGdkbNVjusrWaMjCVF43pIhKWsDehBtXBIwttP/n 32zHASDiLjykr08A1+lYeoNOTxpAOoJr3o+9BQKPD1bCt+0jvWgFQUYFv6pMFPp4ARkT mqsV8739AmY9NbU8op9dpy7xI9/TU02s06hGEd4hAX0YD25XElzFn9AeQiWYyupNXcGH H+oz74SEcLjgaKBupVWzFd3TMO+mekIbPTW/YF4ufYRoWsU91uz5vupyKZiZLrhY0D/0 4fvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679658193; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cEeRHO/zUWvbMymxotAYrIHIcsBog8Q80jrMbSXh8GA=; b=7ky9C8SyF6eFW9sxZQyC93ZmVCxwsW2aXA1/trsuBjnycVm8nBtcS7URV9td39QLc1 9u2DdWYFYp3J8Gxv/IFo21gVsScITHKjZoJ2Lq1U2+TX8GjlPq3nFMN/CvuhupDkMwdY tdnNUcW0YSuvWNdH8Q4INX8IDuRqCX0UGig9dFbt+8LMTo0avqAvT04fYmo5mktZOmqw fehgMhzQUz56FA+kWYFoNVvkfpkLWg/HplTdmtvDCRjao9CKQ7qwMKDXZA8GKkUFlQ75 vsjYRigVuOanvOWV6OrNPVcI5YwURJI3bcbujVWDL4j9/Y8Q0e4SKuKk3/kRxKtArGNW JOvw== X-Gm-Message-State: AAQBX9fDF+Q7gVZJvW0aFDgBybFxsLvG0asKzE/lFu89EyqVz+lC22pT uLKhK6Y4dkVly3k+uIwFFyO6dg== X-Received: by 2002:a5d:6986:0:b0:2cf:ef5b:49d4 with SMTP id g6-20020a5d6986000000b002cfef5b49d4mr1766130wru.48.1679658193019; Fri, 24 Mar 2023 04:43:13 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id a3-20020adffb83000000b002c561805a4csm18190041wrr.45.2023.03.24.04.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 04:43:12 -0700 (PDT) Date: Fri, 24 Mar 2023 12:43:11 +0100 From: Andrew Jones To: Conor Dooley Cc: palmer@dabbelt.com, conor@kernel.org, Paul Walmsley , Heiko Stuebner , Anup Patel , Jisheng Zhang , "Jason A . Donenfeld" , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 0/2] RISC-V: Fixes for riscv_has_extension[un]likely()'s alternative dependency Message-ID: <20230324114311.qjz62iofsrhgdlnz@orel> References: <20230324100538.3514663-1-conor.dooley@microchip.com> <20230324113107.djp4ejnlpzn3qzrb@orel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 24, 2023 at 11:37:05AM +0000, Conor Dooley wrote: > On Fri, Mar 24, 2023 at 12:31:07PM +0100, Andrew Jones wrote: > > On Fri, Mar 24, 2023 at 10:05:37AM +0000, Conor Dooley wrote: > > > Here's my attempt at fixing both the use of an FPU on XIP kernels and > > > the issue that Jason ran into where CONFIG_FPU, which needs the > > > alternatives frame work for has_fpu() checks, could be enabled without > > > the alternatives actually being present. > > > > > > For the former, a "slow" fallback that does not use alternatives is > > > added to riscv_has_extension_[un]likely() that can be used with XIP. > > > Obviously, we want to make use of Jisheng's alternatives based approach > > > where possible, so any users of riscv_has_extension_[un]likely() will > > > want to make sure that they select RISCV_ALTERNATIVE. > > > If they don't however, they'll hit the fallback path which (should, > > > sparing a silly mistake from me!) behave in the same way, thus > > > succeeding silently. Sounds like a > > > > > > To prevent "depends on !XIP_KERNEL; select RISCV_ALTERNATIVE" spreading > > > like the plague through the various places that want to check for the > > > presence of extensions, and sidestep the potential silent "success" > > > mentioned above, all users RISCV_ALTERNATIVE are converted from selects > > > to dependencies, with the option being selected for all !XIP_KERNEL > > > builds. > > > > > > I know that the VDSO was a key place that Jisheng wanted to use the new > > > helper rather than static branches, and I think the fallback path > > > should not cause issues there. > > > > > > See the thread at [1] for the prior discussion. > > > > > > Cheers, > > > Conor. > > > > > > 1 - https://lore.kernel.org/linux-riscv/20230128172856.3814-1-jszhang@kernel.org/T/#m21390d570997145d31dd8bb95002fd61f99c6573 > > > > > > CC: Paul Walmsley > > > CC: Palmer Dabbelt > > > CC: Conor Dooley > > > CC: Heiko Stuebner > > > CC: Andrew Jones > > > CC: Anup Patel > > > CC: Jisheng Zhang > > > CC: Andrew Jones > > > CC: Jason A. Donenfeld > > > CC: linux-riscv@lists.infradead.org > > > CC: linux-kernel@vger.kernel.org > > > > > > Conor Dooley (2): > > > RISC-V: add non-alternative fallback for > > > riscv_has_extension_[un]likely() > > > RISC-V: always select RISCV_ALTERNATIVE for non-xip kernels > > > > > > arch/riscv/Kconfig | 12 ++++---- > > > arch/riscv/Kconfig.erratas | 6 ++-- > > > arch/riscv/include/asm/hwcap.h | 50 ++++++++++++++++++++-------------- > > > 3 files changed, 38 insertions(+), 30 deletions(-) > > > > > > -- > > > 2.39.2 > > > > > > > LGTM, but if it was based on for-next then it could also immediately be > > applied to zicboz. For the series, > > Hmm, I did it on top of fixes since this needs to go into v6.3. Ah, sure. > Perhaps I can create a standalone patch for Zicboz and Palmer could merge > these two into both fixes & for-next, with the standalone applied on > top? Sounds good. Thanks, drew