Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp171617lqp; Fri, 12 Apr 2024 14:04:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6IQED0J6QAIk4aFBuZ38s2Eo0FJD0rPDyACo/Z5JowBHzdk/toANkQCzYVXjz0A5KT9OSKDHXiVtjoYyi70jZS3nGWA5Gw/dIEwXcNw== X-Google-Smtp-Source: AGHT+IGLnUKejHIOrRle1bMy7Mw2gtcgrg2aina94jNQelYijntualJ54ttQaqgTSXOPsqTrlvBZ X-Received: by 2002:a50:ab15:0:b0:56e:2bf4:fe02 with SMTP id s21-20020a50ab15000000b0056e2bf4fe02mr3152260edc.11.1712955844482; Fri, 12 Apr 2024 14:04:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712955844; cv=pass; d=google.com; s=arc-20160816; b=EarI0TIHF3zxjFJoLYyNyTlLO3th2VlySXUAu17kvrYe8jG618ZccXSoNhFMosQDKT X9omeTqEUtIwCuMYk0Brx4Q+JfSLRy+0oKbAIUgCaYoT7uK8twM20tEroUGpfvbb93cg hvpBoiP3Mo6yB1BlK1mskUw8q7APRJp5IjQu8/y5AGAPxuhSUfRUePFvhXI30/dYCbSV p5/4+Bx4z7wn4e7ilMEfmF2lVpHtP9BW0EPoCxm4+VQsdIP78kRz6576razo0x43P4UF bzel3dU5F0JLflHf97Q62l5bjg8z5GPnKqjfEqiIa7/y6iun4vPyWDwqngalqbIb2X2+ 9V/g== 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=aSqmAxropEDfNCG6GQv7daH4xVtfVuXJw9jJz7os0WU=; fh=uGkNj/+AoJaJ3TgDK4GjtFZLWsGAVeIQYpVQoWz/41E=; b=fQbS1XrM2g4wCEGak4xwj3Z4d90xG2yW2ywYQ3q9tu1J9XkpIH9fuojIi+RA5YZyXU TFL727Lzb4SDVgNNCL4RFQ2O8QKM2Cst3Dp5BtbDMdOoA1b+v+2F5FaoKbFM6JGO/ZYQ LA3m+k67v26nSwl3nAP6O8RXtJGnKNyWuD6JpKSEZskYMhSAb2lQqiS18iRv0qxc35kE Uf0K6o9S2nh9H0ydB+HG18FvSpLNdofwOWY3oAdqb8pwEMSqNp0QmTYhUrEJtlCVORNy Hi8zivxjtBhq5MKiBg+nBa1t5cozDfgqBpC81nbNuJCpaSO2uNV3mIEpC0Bazv3Rtx6c tQmg==; 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=LsdnpNnM; 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-143351-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143351-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 f30-20020a50a6de000000b0056e6cd79578si1954922edc.578.2024.04.12.14.04.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 14:04:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143351-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=LsdnpNnM; 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-143351-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143351-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 10CB41F2378A for ; Fri, 12 Apr 2024 21:04:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E7EF15099D; Fri, 12 Apr 2024 21:03:56 +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="LsdnpNnM" Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 0C83386146 for ; Fri, 12 Apr 2024 21:03:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712955835; cv=none; b=WuEtXNtghiR7x8Hu36nFEnp4u/r3pn8lN7lQUx/4QMgIYH4cTRVgzWZ2jdb6mIPmhib5vELfzRKrwTcRSy/+EOh1CexoylExFGXNyhZdszGWZ89Zjr+9vyzGNfR97KPjfBySLOR1KCdwxx+ARs+MMG9H5sLCYEdmEO62dZbdgQ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712955835; c=relaxed/simple; bh=ZPOljcUhl22FSoHSYfFQzaj3bojSiqS5Tmdy9qXTodQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ri1WAdgzBKNJyr0XUdLY2Azh3upiQmgHBSBZC5DbKIMALln+h+A4AuNl2B0S8cn9DfnUpj8I9vt+7/rLJNvYo9TCgyV/ou1hfosUm8x9ZeB8wfafjkFunhtpos3U0FHTgvmryQpj3J7VZ0MeXP1o+U0QwNwIZcbFFBu+g0WILHc= 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=LsdnpNnM; arc=none smtp.client-ip=209.85.215.179 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-pg1-f179.google.com with SMTP id 41be03b00d2f7-5d8ddbac4fbso932164a12.0 for ; Fri, 12 Apr 2024 14:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712955833; x=1713560633; 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=aSqmAxropEDfNCG6GQv7daH4xVtfVuXJw9jJz7os0WU=; b=LsdnpNnM4wuvP2v+D3LUt/tT2f6tB7xE8Yde3hiBTr6yAi6dkmJFRYvQRZJZGzfFUS OXLwDzpUCv7aZPQazhAOLfHBSDqK1FbhWA3rA7sBg34QYkPWwiojVbSejKy6uQdnUWzm ezjgwhyGI2aPQ+Ybh5sydgdf1JwWi2DMECjD7UagFx/1Wrer7B8N4Cz47wigorbuFYzf qS19WnVJFMIIiiDg8LiXubDWyNE0yps8nABs5yvytmjZbwqbyNip4Xinnv6YV/YbzU44 acAybz2ZwHOn2rJ34rD9wWWFacmZ0VPTwFGgpiDrYapz2ai6PnY7jGW50JYxcmno8XF8 AWcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712955833; x=1713560633; 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=aSqmAxropEDfNCG6GQv7daH4xVtfVuXJw9jJz7os0WU=; b=A4vnnxCGJHoRmmqVwStt93zEcY3ra6+Bt2uUYXlNOk/u0Atxr0Ndcp2eXH8LIZGXWZ VbtvmCemNjx76DQhiW3NeW3A2da34AQQrxGXLov4GmZJmqc8kVvaee22yU3W8I+sGO5y uvA9Kyrku/d0jVlIYhbbVevxr8r6AMfWgbTww+/j8ySQ3dXQZD2+UUaGINfTYcl0m3Zb 4MMUVlgmDzZlctC3zg8WS5FTziWZN045xp7tjrUcVmHch8TBDSiDLi6cI6JxFTPOe0SG LuoZyBSlyDNe1b105ELo0J/7mLsM42hxhI6wuqpXRwwgOGhLVFE3rrMUwcePup2Gfq48 7gag== X-Forwarded-Encrypted: i=1; AJvYcCUjHmqV2Zk0nP2jbHspVGj0f6yxge0McOPmVV+sb8yCPiCBSe7cA5jVmdqojcNPEDp8q9KjhCJkb9YCzJtNmoz3V5sjk9UwlFTEiBOY X-Gm-Message-State: AOJu0YwxefrQhw4/NTP2Re0MHlft7IQ6KeI+hhSxv0dcnVnyJv8IhwL5 022mGruNKFd2LYGloEidNC0iYFaBLgauovDyAWoUoZ/ILWfaG74tF/3CRTW+khg= X-Received: by 2002:a17:902:e5c6:b0:1e2:adce:9139 with SMTP id u6-20020a170902e5c600b001e2adce9139mr5386874plf.44.1712955833353; Fri, 12 Apr 2024 14:03:53 -0700 (PDT) Received: from ghost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id f18-20020a170902ce9200b001e511acfd0esm3424844plg.140.2024.04.12.14.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 14:03:52 -0700 (PDT) Date: Fri, 12 Apr 2024 14:03:48 -0700 From: Charlie Jenkins To: Conor Dooley Cc: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , 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 08/19] riscv: Introduce vendor variants of extension helpers Message-ID: References: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> <20240411-dev-charlie-support_thead_vector_6_9-v1-8-4af9815ec746@rivosinc.com> <20240412-dwarf-shower-5a7300fcd283@wendy> <20240412-drab-french-55d8ff2c8cfa@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: <20240412-drab-french-55d8ff2c8cfa@spud> On Fri, Apr 12, 2024 at 09:40:03PM +0100, Conor Dooley wrote: > On Fri, Apr 12, 2024 at 10:43:02AM -0700, Charlie Jenkins wrote: > > On Fri, Apr 12, 2024 at 12:49:57PM +0100, Conor Dooley wrote: > > > On Thu, Apr 11, 2024 at 09:11:14PM -0700, Charlie Jenkins wrote: > > > > Create vendor variants of the existing extension helpers. If the > > > > existing functions were instead modified to support vendor extensions, a > > > > branch based on the ext value being greater than > > > > RISCV_ISA_VENDOR_EXT_BASE would have to be introduced. This additional > > > > branch would have an unnecessary performance impact. > > > > > > > > Signed-off-by: Charlie Jenkins > > > > > > I've not looked at the "main" patch in the series that adds all of the > > > probing and structures for representing this info yet beyond a cursory > > > glance, but it feels like we're duplicating a bunch of infrastructure > > > here before it is necessary. The IDs are all internal to Linux, so I'd > > > rather we kept everything in the same structure until we have more than > > > a handful of vendor extensions. With this patch (and the theadpmu stuff) > > > we will have three vendor extensions which feels like a drop in the > > > bucket compared to the standard ones. > > > > It is not duplicating infrastructure. If we merge this into the existing > > infrastructure, we would be littering if (ext > RISCV_ISA_VENDOR_EXT_BASE) > > in __riscv_isa_extension_available. This is particularily important > > exactly because we have so few vendor extensions currently so this check > > would be irrelevant in the vast majority of cases. > > That's only because of your implementation. The existing vendor extension > works fine without this littering. That's another thing actually, you > forgot to convert over the user we already have :) Oh right, I will convert them over. The fundemental goal of this patch is to allow a way for vendors to support their own extensions without needing to populate riscv_isa_ext. This is to create separation between vendors so they do not impact each other. xlinuxenvcfg does not fit into this scheme however. This scheme assumes that a hart cannot have multiple vendors which that extension breaks. xlinuxenvcfg is really filling a hole in the standard isa that is applicible to all vendors and does not appear in the device tree so it is okay for that to live outside this scheme. > > > It is also unecessary to push off the refactoring until we have some > > "sufficient" amount of vendor extensions to deem changing the > > infrastructure when I already have the patch available here. This does > > not introduce any extra overhead to existing functions and will be able > > to support vendors into the future. > > Yeah, maybe that's true but this was my gut reaction before reading the > other patch in detail (which I've still yet to do). - Charlie