Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1853226iog; Thu, 16 Jun 2022 15:37:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uCK/5j2yVqLFQyI9REDWKneolpTU6iZibQ/8qFPz8nzXjr5WdNkzIFhcdrWsl/Q67yfQWA X-Received: by 2002:a17:906:1d1:b0:711:f5fa:4114 with SMTP id 17-20020a17090601d100b00711f5fa4114mr6679130ejj.228.1655419027581; Thu, 16 Jun 2022 15:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655419027; cv=none; d=google.com; s=arc-20160816; b=nnJMdLpaN+iyc7iyD5zPJkLTAPzo3P+fBD8XCx1g7Pl2/cW21CnzL/zTaOsDdV9w+8 QBLlj9CcTkbMh4ck8ZnCCGkXENbp7YXkNqsCayeqL/cTzNCXo+Kn1EuUDnBXzLP3byPX rVFgBVvBxmO0dpx3FS7Ho2d/llMbuSU5xhLR2l25wPrRm+MlIi4YT52Yv2m5si1pTxNH g5pBQ2dw45/3RJAKlyYTTgNySd6KsRCZ3jj1ITejtwAD+A47uSpWdlbu5qtPCMvdeq9A gcQ6a7loZwr76quRlZah8VyItIojU6x2lWncCi3apLZQcf3z7GgVzV3d/dMGIwVqgoNj OGdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=l7bNYgy+kj8u/jxC0moNwUt1/A1dWzpe6enKDLs3CYw=; b=a/oAtG5s/kk7VLgmI7k7OYanhQCtQUv1+iG7qHzKNR7BMp03wGiM8y4k0xUXKnaRh8 Y4tn9E/oxEAHFksSImrTJInvxHUYLOOQr2epIAxXipp8CrsS9pW4uOkWNWDCAo/lQb67 hB/5wjDNCJWaGmn6xyxUW98s26EeJiBRK6ujLd1Nrl/EISJbXx1fjIrysi1vtV2DdztP im23JK3FlJGpG2QR6ZfvdP6edC2lanaedITlLvsPl63/Ny7JGDveQsmSYqgN6g3Rh/Kh 0DtDt2dCXPHLLEgsc9+88yu+gU/s6NciRT/VKDvWsF86hS35z9EzRamlmx8rK/Mi0HAM RQOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=vbp6VGbX; 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 p17-20020a1709061b5100b00711ffe66bf3si2773674ejg.612.2022.06.16.15.36.41; Thu, 16 Jun 2022 15:37:07 -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=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=vbp6VGbX; 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 S1379068AbiFPWFT (ORCPT + 99 others); Thu, 16 Jun 2022 18:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378572AbiFPWFA (ORCPT ); Thu, 16 Jun 2022 18:05:00 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91DE61630 for ; Thu, 16 Jun 2022 15:04:52 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id b12-20020a17090a6acc00b001ec2b181c98so1373082pjm.4 for ; Thu, 16 Jun 2022 15:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=l7bNYgy+kj8u/jxC0moNwUt1/A1dWzpe6enKDLs3CYw=; b=vbp6VGbXIF+ANmagPv6oY9KhOIlXhEJ/vbaTYawbBSJUALwdTygMrXNi6hIbI2uVtA WDsDi0e7k+bgkXHlj45ijFbhfBjcycXF6UY5ZYfJ+MWZ0wn3tkcFEABG0WRFtdpVTpDX dGC0zHuucnNwJXo2U+7H90bxpNRp37Lp8v/wgZajKi09AnZ+nq6wN2ICLne/E6Qc4ASE pz3iw3f4no4zX/fQLqTUVnjjtSDz7V7RuU90fOB9lkGOpQrVPY6R1GnVjSjudzsMpJqq HTWXNrG2csc19lOCRuYMGtROF1jKTVT0wTQZTFK1pICfVcZrImaZdHtzr8mmIBtaKS8M xP5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=l7bNYgy+kj8u/jxC0moNwUt1/A1dWzpe6enKDLs3CYw=; b=wQUUITfDU5OsYKs+6ofdVcHn7Filjt5xnFApQhh0lO85JHFZK5jdrYzOjC9BUlokbM WxA+TkOyRc/+BNB8Hi/by1qhkRZIOaxY31ZG8kEX6XtqvOffTX4/IPJOHfkmqJCtZAnm kgQeT2TtKXD53iBpI12pXU/e91AH2wLHUnlJFM6QS6J80KlXhGb/qhY2yhh2+wGgw4z+ GRNPrnQFeG0fBg/rSBDdQ8A0eqcyyApsEkepyvdCp/f74dns1WhmU+OZzJimJO67GAUy Ro5/LjWuhPfATdD7Q3Av11HzJ+SmSXtGS6jV6/6xWjN7XdaPVT+eyiyBELi7mH2aRSeA 9WwQ== X-Gm-Message-State: AJIora9wKgFy1D5XlAOQxv5VbKc0EJcSVu+O/hryv2mIWeuN446SuniB 5s7kYi+gypto9zREFcECg/ku9Q== X-Received: by 2002:a17:902:9348:b0:167:8e92:272f with SMTP id g8-20020a170902934800b001678e92272fmr6779739plp.77.1655417091611; Thu, 16 Jun 2022 15:04:51 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id r24-20020a638f58000000b00401a7b4f137sm2311093pgn.41.2022.06.16.15.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 15:04:50 -0700 (PDT) Date: Thu, 16 Jun 2022 15:04:50 -0700 (PDT) X-Google-Original-Date: Thu, 16 Jun 2022 13:10:07 PDT (-0700) Subject: Re: [PATCH v2 0/2] introduce unified static key mechanism for ISA ext In-Reply-To: <20220522153543.2656-1-jszhang@kernel.org> CC: Paul Walmsley , aou@eecs.berkeley.edu, atishp@atishpatra.org, anup@brainfault.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: jszhang@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Sun, 22 May 2022 08:35:41 PDT (-0700), jszhang@kernel.org wrote: > Currently, riscv has several extensions which may not be supported on all > riscv platforms, for example, FPU and so on. To support unified kernel > Image style, we need to check whether the feature is supported or not. > If the check sits at hot code path, the performance will be impacted a > lot. static key can be used to solve the issue. In the past, FPU > support has been converted to use static key mechanism. I believe we > will have similar cases in the future. > > Since v1: > - fix typo, thank Atish > - remove riscv_isa_have_key_extension() instead use the isa ext keys > directly as pointed out by Atish. > > Jisheng Zhang (2): > riscv: introduce unified static key mechanism for ISA extensions > riscv: switch has_fpu() to the unified static key mechanism > > arch/riscv/include/asm/hwcap.h | 25 +++++++++++++++++++++++++ > arch/riscv/include/asm/switch_to.h | 4 ++-- > arch/riscv/kernel/cpufeature.c | 14 +++++++------- > 3 files changed, 34 insertions(+), 9 deletions(-) Thanks, this is on for-next.