Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp697285lqm; Wed, 1 May 2024 12:48:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXaPT2A5SxiSb+hovvXcx/mLERfXIlx5aN4QylS+XbhTwlK9KdQOtO5DokLU+bwdzU/ybsoz8z5bNnqS93U+FcxmSd4N6hTtSiu0jBZAQ== X-Google-Smtp-Source: AGHT+IHxRtarYvNTQ8qUv8z0TEU9dPSZGS5qtewoS80nwTCEECxKRaa/1/RxQUqHBYgXMhPZeQ+I X-Received: by 2002:a17:906:34d9:b0:a55:a670:4e63 with SMTP id h25-20020a17090634d900b00a55a6704e63mr2304617ejb.13.1714592908711; Wed, 01 May 2024 12:48:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714592908; cv=pass; d=google.com; s=arc-20160816; b=rXd9w81TR8jskYiM7AhhjgEboCJgsUQHmO0BVJ1l1INPkKw2OWv0Dyw+TkynItwz7i 1rkP6qi9aXYcFW3RcHNU+/h+g1r8Zui3+G3SvTW6q7pppLwN7459oL0un+rTGwzQv7iL aMWKH+JYvsd9XnC0oLbtD02cNysK0jJSqY85fLDOEbMbEPhfGcxVj374dVMVeN6wuXpB pHne6MBCQ8XfXeVE1RKWdp/xEA0oBPPLZ/LGrz5ooh9DBO4Y55G362lYxRQg4F+p18NZ aVK7aqOqeumAJoN2neFH4bjGJA4BvUQmgyCmcgsPE/0QW1V5QfwF/agyVVJHfFVURB6k BGyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JtC8dm20imTdKCQqTW5smBrp6Y6uvCPu1xFL49hxPB8=; fh=ihP/C3d9gQwkdio0N//ZRK3Sfl9jYQ+gnxPSY85iwFI=; b=ZWAnIndhCUqc4n1iykTTgdSHO/5b97ArY5hgyWadktkrigoz3AB7NOl7T005ogeJGs 0vAi9cRF2XjTDdjtX/Jq/xaVdOIlad7ZTrwhyJEnsx5g+JJMgqoq2DGmh5j42qcvigJr LuEPRa1NhcfOi/whmaweUTwbK92E1aUmwqnxYL4qfE0AFS7Zc4HvjLo5iBqenypwnhOp bgFIxLArafYG/GsB/Lubxy701taIS1+K1VzJHOMAlNJ1uElyDpiAwxtcBtiWsNqGAsJR DeMjAHfFlsTTGVT1x2ED2udvEt43jEk9/q9HW3pDBWlUxKClaZiR8hV2CQh+x7mzPFGO gJow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=iwWN7QxB; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-165723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165723-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gh1-20020a170906e08100b00a51d2f1e65csi17195966ejb.252.2024.05.01.12.48.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 12:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=iwWN7QxB; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-165723-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165723-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 71C2F1F20DD9 for ; Wed, 1 May 2024 19:48:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 839D116191E; Wed, 1 May 2024 19:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="iwWN7QxB" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6117C16132E for ; Wed, 1 May 2024 19:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714592899; cv=none; b=AgzoZfnutO41QxCP5Zbb1Ecn6DfOTdfePtVldqFBS33vMuO2x0ljqRhjKrIjbXx7tKXyvg3Xxx1M8LWJIerix8yLbUi+z91pBP43rNZKzOYKL9TpK0tf63U7FGS3tDAGYIgRUsu+XgkeWIUx0NDNlCPeEGE93pLTxBi+z/yaVZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714592899; c=relaxed/simple; bh=0xusBx4mvpGkzkWD4XBTeQoGUcYyDndMqcZwmTR7iPg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XwchsWL1R7We7fXi7GgV1OY4gufJaDEXSZPeAMQjtYebH38XsgpDbu7kBi8L+wJcUi0gQYN5YGJBTB1hms8P0u4IFBJ0O/BeQdF9zq8iUUUjh3T9DrCkbhYfOOc/dzN7d+BuphzSeWd2C/pEHPomEC67iK2hVkOtUcbidJxxQls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=iwWN7QxB; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1ec92e355bfso9847295ad.3 for ; Wed, 01 May 2024 12:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1714592897; x=1715197697; darn=vger.kernel.org; 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=JtC8dm20imTdKCQqTW5smBrp6Y6uvCPu1xFL49hxPB8=; b=iwWN7QxBz4DTHm1qm4OvpmvNaVrshOl+oNlLUJKpgpYips6mizmNWeGngZ7RT2SCYn 6kyWULXJJiRSqRABB3YLom9mKVl7O1GRH3fO9iv+zXLQZvX8IujkF5/OkVWuuIxYIvHk czSTItxHcV3PGWm9icjiVq4AXktjZRr5Kg93KsO6cUnLQ2Jc5ZldYY/TJ7lZNBsay4yN 104GtD7bPaL5esKEKFEBLc2v7xelq7wUgkZrgAtJs7G50S0j5ehcLdzzk9mP//qrHDox kvR0sCoMr2n5O61swCfODCxdsx5HGrewfmkIb63uTPTpCi4pYISkNFaS/0d+8/TuLx3b 8NGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714592897; x=1715197697; 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=JtC8dm20imTdKCQqTW5smBrp6Y6uvCPu1xFL49hxPB8=; b=sxB5jjRDQ8A75/KsgeBD7qXyFRuEHtXPy8T3nxCN+3t/iSwlSoD56MHX7FQbw4LcL0 hKBso9be9UCaAcQjF8qORqMk1gQNh77SzL5mqCxz5Rh5+4iL9Sv94g7i1u5bOv1PuXsD +ZfCJQEATsdMFjN9ZFVVrxONPgg9s/kb+k7tY0t7heUsqfaC77qFtZafC8cFuUyGXkYv Z2mGMUSRu+ldgFX3IzFpju9RM+15ZSS8C7aeZxiygqsgCB65tXPTppvy9QkZpOjbq9wc nJYMmgs8K6kPLxGyryR4SiYOKkRGYObtgaedrKr0qWQ1CkTBKdM1XzNMxxvTfzLTGTtr ngag== X-Forwarded-Encrypted: i=1; AJvYcCUHWk6p0n6SXejON5prg0F1/BH4IbclAAKtxT2hOTSf5S+JHwJgl62H6K7tzYQ9mfutY4/IFOgln6XGhYGCnLh2Z7sMq/yDiwBXPsuS X-Gm-Message-State: AOJu0YzjEdfIBk+O2Mbw5DPGXsxYJkoIPlPGeCYSr/jntiDYfFIjH2uM B0ggU3+qq4LCK1JGBUFyY7ObzanCE9KG3A39nqKSB5GMuyZyGa6X36L7nkqjLLw= X-Received: by 2002:a17:902:d506:b0:1eb:2fa0:c56f with SMTP id b6-20020a170902d50600b001eb2fa0c56fmr4034243plg.35.1714592897320; Wed, 01 May 2024 12:48:17 -0700 (PDT) Received: from ghost ([2601:647:5700:6860:1dcc:e03e:dc61:895d]) by smtp.gmail.com with ESMTPSA id j10-20020a17090276ca00b001dd69aca213sm24321702plt.270.2024.05.01.12.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 12:48:16 -0700 (PDT) Date: Wed, 1 May 2024 12:48:13 -0700 From: Charlie Jenkins To: Conor Dooley Cc: Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Jonathan Corbet , Shuah Khan , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 07/16] riscv: cpufeature: Extract common elements from extension checking Message-ID: References: <20240426-dev-charlie-support_thead_vector_6_9-v4-0-b692f3c516ec@rivosinc.com> <20240426-dev-charlie-support_thead_vector_6_9-v4-7-b692f3c516ec@rivosinc.com> <20240501-probable-unfunded-746ef6ae1853@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501-probable-unfunded-746ef6ae1853@spud> On Wed, May 01, 2024 at 12:37:14PM +0100, Conor Dooley wrote: > On Fri, Apr 26, 2024 at 02:29:21PM -0700, Charlie Jenkins wrote: > > The __riscv_has_extension_likely() and __riscv_has_extension_unlikely() > > functions from the vendor_extensions.h can be used to simplify the > > standard extension checking code as well. Migrate those functions to > > cpufeature.h and reorganize the code in the file to use the functions. > > > > Signed-off-by: Charlie Jenkins > > --- > > arch/riscv/include/asm/cpufeature.h | 78 +++++++++++++++++------------- > > arch/riscv/include/asm/vendor_extensions.h | 28 ----------- > > 2 files changed, 44 insertions(+), 62 deletions(-) > > > > diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h > > index fedd479ccfd1..17896ec9ec11 100644 > > --- a/arch/riscv/include/asm/cpufeature.h > > +++ b/arch/riscv/include/asm/cpufeature.h > > @@ -98,59 +98,66 @@ extern bool riscv_isa_fallback; > > > > unsigned long riscv_isa_extension_base(const unsigned long *isa_bitmap); > > > > +#define EXT_ALL_VENDORS 0 > > It's not really "all vendors", it's standard. Otherwise, this seems all This hooks up into the alternatives: ALTERNATIVE("nop", "j %l[l_yes]", %[vendor], %[ext], 1) Where the "vendor" argument is supposed to be 0 if the alternative is applicable to all vendors. Is there a better way to convey this? - Charlie > grand to me, > Reviewed-by: Conor Dooley > > Cheers, > Conor.