Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp216010lqp; Fri, 12 Apr 2024 15:37:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXp9tryArGnneTsvj3NT7glLHa48rK4/n+2aufrb7bhb+hy/dkcmPmlIzYvMcNsBn/8Rg8fUOUDkgPj8YvTvU95Lxf7gnQkn7hBdqvaaA== X-Google-Smtp-Source: AGHT+IE4eWKvIp1g1m2KwhL70oKDX3pXO+DwFFVviL/l7SKHewO8V2fS3uIbQ3ZlqjGf30QSrreR X-Received: by 2002:a05:6808:2cd:b0:3c5:f293:fd33 with SMTP id a13-20020a05680802cd00b003c5f293fd33mr4009906oid.24.1712961451045; Fri, 12 Apr 2024 15:37:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712961451; cv=pass; d=google.com; s=arc-20160816; b=o9BRDo7ityI1em0erOXluiGu4ahbV66iQGMRxel4KAL/DBw/YwpXRGa+3+v04kSMbl MesBHgIWkMQh3PTbSpyxgbHUmpMMnl6FHHUoJ8BgM5rRynYMBrXE9fH8DXzxFZuLjxle nbavM98JD/VN0oviz2YNco5W2tcreB4PjwlxkWSgHF9TX7NQ0/3kWHM3++70AOe5ROUv ++ppF41tiS1z1SdKCJVdPXRM5rYyK9VyDJwJ/Cx1FMK34pGc8a0pUo+MrFD3/cSJC4Tb PkWYhxcYcLJ+NFtxTZbEVgNn1CbhGq0e/w6X063KAZa8tQ4vKFvKlnHlDxdGr/bbtooy pHyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HKc5QOf/ZMb9xWTXmeJjFB5DhU65yjVEdJ5QMQR8HHA=; fh=w3iPMyC2khf+MhS+C0lTq7LMhEk2sHFp11Sm+Ryds+I=; b=L5vfcQfNd7dDhh9mFz8PKg71PUoVGX/3JJkve4L3p3EUI8qNtAemN856YND17BcWiF AzY2S9s6HqwrE9DmoABc1rRQgZCOfUWFNiq33YlrlMSbDYAdIjOMneMLiBvPL4w777bZ bDeIiu/HF7Yb8MXN7GqbKwSP/C0UP/FL/lKwxR4clZjQ+3Nx9MiFHFKefJQ6mCkAhXrl Ly8T2EU9zEIzDw3z3C8l5vgEx5H8N04AX3qstTAcC/SGtqYDtJpNl2cm7KIyLGEsIvVq HBUHZ9tpKX8kU0X8zfEh7BI0I10kOQDi8Qs5dR3D0NKSLX2yVtWRtMbHIjVLhoNCHXro 6iNw==; 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="BPgCQh/k"; 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-143412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143412-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v22-20020a05622a015600b00434bdeef5easi4786963qtw.243.2024.04.12.15.37.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 15:37:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b="BPgCQh/k"; 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-143412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143412-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A98661C21A98 for ; Fri, 12 Apr 2024 22:37:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C2DC148FF1; Fri, 12 Apr 2024 22:37:24 +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="BPgCQh/k" Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 D56A94DA13 for ; Fri, 12 Apr 2024 22:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712961443; cv=none; b=cw1EaVoWxAWCHzSQ6rblPhQdBp+X63aylGYl75TwxmoCcALP99SLnJdUS2gGD/MFxjpxvWQlpy1K78QHV2sF/z7AGXNj24NvOgi0p5tDN7L4/6QMTVnU+ojzAHz92bn/WSGlE8d4o7jI5fusyFcFs8XvYQTEY0lu9AabmZ012EA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712961443; c=relaxed/simple; bh=AAQQiOP+zTxgw859Qwy68m1EG7SPBqIf9+JwqKoC7Xo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=icbCnVU8EMUDWWuYofabSsFnG/uEIstu3VEJjfeWkqKyMn0MyNaoOBelj8w6x+JD1aZVPsuF5xJ8ib5k21H5zjoPUEqZfe1buADRcKQLPk1wW+uzHrhuRbaypSF8Jry1f8/Rmnvf9Uha6ABSndGrMCvO1FIk6QNO9wl0pUJXGJ0= 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=BPgCQh/k; arc=none smtp.client-ip=209.85.214.172 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-f172.google.com with SMTP id d9443c01a7336-1e50a04c317so8376235ad.1 for ; Fri, 12 Apr 2024 15:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712961440; x=1713566240; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=HKc5QOf/ZMb9xWTXmeJjFB5DhU65yjVEdJ5QMQR8HHA=; b=BPgCQh/k+T/ncnUuo7UVhPwLSk62LaFQt0e4yBgT9XpNAD3eFCqhmObvV2pXfa3Tt8 BCnPytgp1mwAMVQf6GmS+bIWQogo/voMYhxT0CFWdsxznLFP9SgCb1Gv+BehpkhGx3G+ VsX1G04meUMprjfhMSOq49TFVp8mRD2kAJThZrTonwGFAN6SksdFyW4m9g5TEZmTRV0b RuekWT04mI2dcQYCIQdYj7lVcby3MKSEsi7GyVApnsJosdCVf8dhg1tGdcMiS9gAk7Xp dExSV0cB78dOxdNyNiZHNSrxk7GNsb6SU9B100cyPGTC/xjwcaIDs0YrojUNCQit6fFI /ccA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712961440; x=1713566240; h=in-reply-to:content-transfer-encoding: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=HKc5QOf/ZMb9xWTXmeJjFB5DhU65yjVEdJ5QMQR8HHA=; b=mFDDJWkmKFvfER/dVoXMXkQgz7IjK2OXOCdSDGcUeWE83978d/ZkncLwdBfKHKrpBh pOJzPEvECf51lcDr9fVF3r2y5fzPaODS5tv6ToNkUn5art5rlPhvncyWf6bZ9NcfJhbY DnmM+SAS6M3KOklyWWSUrxmCWtPmt5/DCzslAGdDQY/uUWsBer0PWAvqL/FMf49uKrTL kyt2SqcLp5SqYsqKMkEX4dr8Iljmxw1nfHHo6vltxYvWafXBg0oKLE4L0qnNAXLKU1nk 61nyd/gKQc1Uc6ADREk1nHUE1DTBMp7AU14ZYDcQJG7lZ/7YYNzpPO/mxYrboV2UzLBP U0/w== X-Forwarded-Encrypted: i=1; AJvYcCX5Tdgqe0O3c11UDo/kywgfECjVc1d/hP7SZXWc4DMHmX4JfYXtd/H/pjhDJqdLex4XMGbV0kk5+geeeybcMlAqpH6xc/p049S2i9a7 X-Gm-Message-State: AOJu0YwTNPkSqokoFu/5zm6X7EooGpHZR+od0rWdMOo7m+MUA1Zn3/7I 59Nl0u1R2fNVQ9aAgHTLei2FpeV/1KwCnxteGh0AWpE5ihOgk1jFph0fqoXkbcw= X-Received: by 2002:a17:902:e5cd:b0:1e4:952c:fafb with SMTP id u13-20020a170902e5cd00b001e4952cfafbmr5259647plf.2.1712961439988; Fri, 12 Apr 2024 15:37:19 -0700 (PDT) Received: from ghost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id s14-20020a170902a50e00b001ddc83fda95sm3492795plq.186.2024.04.12.15.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 15:37:19 -0700 (PDT) Date: Fri, 12 Apr 2024 15:37:17 -0700 From: Charlie Jenkins To: Evan Green Cc: Conor Dooley , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , =?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 14/19] riscv: hwprobe: Disambiguate vector and xtheadvector in hwprobe 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-14-4af9815ec746@rivosinc.com> <20240412-moonshine-acting-0df1a90b86d2@wendy> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Apr 12, 2024 at 03:08:31PM -0700, Evan Green wrote: > On Fri, Apr 12, 2024 at 11:22 AM Charlie Jenkins wrote: > > > > On Fri, Apr 12, 2024 at 10:04:42AM -0700, Evan Green wrote: > > > On Fri, Apr 12, 2024 at 4:35 AM Conor Dooley wrote: > > > > > > > > On Thu, Apr 11, 2024 at 09:11:20PM -0700, Charlie Jenkins wrote: > > > > > Ensure that hwprobe does not flag "v" when xtheadvector is present. > > > > > > > > > > Signed-off-by: Charlie Jenkins > > > > > --- > > > > > arch/riscv/kernel/sys_hwprobe.c | 4 ++-- > > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c > > > > > index 8cae41a502dd..e0a42c851511 100644 > > > > > --- a/arch/riscv/kernel/sys_hwprobe.c > > > > > +++ b/arch/riscv/kernel/sys_hwprobe.c > > > > > @@ -69,7 +69,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, > > > > > if (riscv_isa_extension_available(NULL, c)) > > > > > pair->value |= RISCV_HWPROBE_IMA_C; > > > > > > > > > > - if (has_vector()) > > > > > + if (has_vector() && !riscv_has_vendor_extension_unlikely(RISCV_ISA_VENDOR_EXT_XTHEADVECTOR)) > > > > > > > > Hmm, I think this is "dangerous". has_vector() is used across the kernel > > > > now in several places for the in-kernel vector. I don't think that > > > > has_vector() should return true for the T-Head stuff given that & > > > > has_vector() should represent the ratified spec. I'll have to think > > > > about this one and how nasty this makes any of the save/restore code > > > > etc. > > > > > > Yeah, my nose crinkled here as well. If you're having to do a > > > vendorish thing in this generic spot, then others may too, suggesting > > > perhaps this isn't the cleanest way to go about it. Ideally extensions > > > are all additive, rather than subtractive, I guess? > > > > This was the "easiest" way to support this but I agree this is not > > ideal. The vector code is naturally coupled with having support for > > "v" and I wanted to leverage that. The other concern is all of the > > ifdefs for having V enabled. I can make all of those V or XTHEADVECTOR; > > that will increase the surface area of xtheadvector but it is probably > > the right(?) way to go. > > For the ifdefs, if you've got a Kconfig somewhere for THEAD_VECTOR, > can't that just depend on the V config? We'd end up with the > limitation that you can't add V 0.7 support without also dragging in > V1.0 support, but that's probably fine, right? That's a great idea, thank you for the suggestion. - Charlie > > -Evan