Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp533978lqo; Thu, 16 May 2024 13:29:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJUbI4prKbkY5iY1TEpeEimGGGWSWekN9GJXF9HATc2ltuvYa51rpH0Mkqm5GbfTy/kazLdBbdN009sLg8F0f1wKzGTvmwiZ5akjbA8w== X-Google-Smtp-Source: AGHT+IFfa5zFievHngIftQVBHEy5+Iv7bnrDuq7qRsZmi0pSroWNNSMYr6ew4j41zEPoMs5PEG83 X-Received: by 2002:a05:6808:178b:b0:3c9:963b:7f7f with SMTP id 5614622812f47-3c99706a5c7mr28081220b6e.28.1715891364260; Thu, 16 May 2024 13:29:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715891364; cv=pass; d=google.com; s=arc-20160816; b=IWuTRzMo47TZk4AGj8wdDEwFRS2m4rrfvwIK8oqhW6Lpmb0GLIytLXX3fy0erJps6D cEG/lJaFaNeWRxFIqh2PTjUfrkCZ18xKbbZgnGR8MQ2+dSMEi7018Q69rMlUD2c0SSqG VXf7iUFtVpO6bD5i8FB8xE5Q8TiOkD1fWgONzqyLH4cy04/pZH3/EKD30o9kaZngaffz /cbKH9QPVYyjUSDwjjtjhSg3tSp+6FB/XFORDFqp0Ala3DTq2yMDnofnki9V5ollQPYD EYZSAd7zRsWbPQp4eJgleFxwTAmoBHV+Oxd7D4hZjzZ55/F1PU9vmMAHCUXVsRDCZNtc ietQ== 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=Y4kKN9JX8nIOafaZ0J8qaWRBKY02LqUa/O7jwO2X8Tk=; fh=IpSvCtWdFQ3JGi5eIlIwg9BDONozM4wLEQ0Drpt+8VM=; b=JMvnZg2CFHjVOJQGniKJ5Ic7vK1omx5sylkFsiwBAKZGpia6GqUShkyShJElLe4VeU t+KEqV5OQCWiyJD6SAFrUmGkt3Krt+yt/ErqWisaPn6Z6W3JA3Udtw1EisuxCyoIKPq1 coR6LSDo3ck4m7eZIKb4WAZJd77Sxpezx8K6kPfenCbg/sCsVapUF3FsXPZ7fcN77x2p rU3lms1xoL7nKO9LVkhUaQlJTpCWzYuIK8ptPEfrsF1MaiPOAL6H0r6pg0XMBYOnm0Th IsIVlEux7aWJfaEdupL2iGgZ7gBFLSowPO8j4XBxrnnoctHpmuRwStCnmonb9CNn98q0 Ib9A==; 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=f7I5TVmz; 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-181563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181563-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 af79cd13be357-792bf28c9c5si172162585a.174.2024.05.16.13.29.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 13:29:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181563-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=f7I5TVmz; 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-181563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181563-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 B95861C214B1 for ; Thu, 16 May 2024 20:29:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA864158219; Thu, 16 May 2024 20:28:52 +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="f7I5TVmz" Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 576441581EB for ; Thu, 16 May 2024 20:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715891331; cv=none; b=bLOxxnMt8pH1QYFgbXMtUpmmpfcZ0s4J9HA6Q/qyiOM97ajQEdXIi0yrFdhtMUIgtaZO5OA+aIGmiGb/SsRUVJkVVGSLM365QNwj1FM7PT0/KUIqyJisjNOq52Q0IAznZJpCJXt0wesyI5XUOuzwfDn1WcTPxhTwGaT3yrgcWiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715891331; c=relaxed/simple; bh=kC5VynHMsC9YRLX685duYC0SDWhDLE4h76tMsTIxJ7c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oIP09SgxeO39C0y1smIRHzzCKgMW9J0YMxUf7SHxDU7BoOBv+3kRqy9/0cV9HdXVyXcs7lM59Zi3oTlDBeCP5eUOjrysFD7BrLTn62c5SBH2NRPHHVqfvKod1nCn134tWr3MWD3Zs4uBXLowWD7H5im93qBkxJ3vdkiDG7gN/mA= 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=f7I5TVmz; arc=none smtp.client-ip=209.85.215.181 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-f181.google.com with SMTP id 41be03b00d2f7-5ff57410ebbso562079a12.1 for ; Thu, 16 May 2024 13:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715891329; x=1716496129; 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=Y4kKN9JX8nIOafaZ0J8qaWRBKY02LqUa/O7jwO2X8Tk=; b=f7I5TVmz2dloZY3tjfcb5pTQNrPv0mLDrOCxzWIsorznjnTAKpjQIk2IS1USv5ZOZn h6qMS3dnyGPXkfUm1kBhXc6bMUxqcsLHmZdxBi9uvrn9j/N9YOgOgJgi4w/PuAsk9b0P N+M/GOHyvHeBcMonuA7mFVcbdF1avWueWc+YH4IB0t5NLsCgMfHxqgDuExKmFr4AAb1k /3734/J7SJPaw2Lqh6tJEkGsr/kQSlBIrGkK+dz/FLwqyhTYVkuBUGcmGllwhJXeHwiY zSGH54rdSKfee9jJiz5ZGDxT6uEmbTQwF4+9sPh9DU5dWSKE9GHevui8DxO7l0zlHQTS aiZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715891329; x=1716496129; 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=Y4kKN9JX8nIOafaZ0J8qaWRBKY02LqUa/O7jwO2X8Tk=; b=om38HtU2tANBW86EqStlRKs0ANFUQMfT6+0SL2b1wuiv5q149b3ChDj9arGcC1EwsA /UUB+O/9j+sdM7IH87O31MI6Tsv+tvc6lpObtvC5yYF5+Mfac3vSWOSKtXpwa88rjPeu 6tVn6LIt+xleY4EaStkQZyFKpQ1KV8WJb6Qahl0Lq5bHRDFG8XuiTGPR4/lLHkAf/OvO xFqWFq5V+83q5Jq/92PQSaVtPsnLxS1fy2MhTOuoWRhAG88EZiCMQzI1oZ2IgMVWAN63 RmfQ5h/bC0MQxL9YhfX1nJ6SNwRk/bODyB9tvbMIf8N5o9Kx2GESNCXn6WWNIgYkBSY7 9Yrw== X-Forwarded-Encrypted: i=1; AJvYcCV9t2AvK+TnsCgkF6BlayDz5DDoaMhFHpcH4pgTjvyRaUS0VoMQ2F+LiM9yLtPJ4NQ2zAm58RaHXXNr55GWaDJm/Ne385H8ktMPWwBm X-Gm-Message-State: AOJu0YxFmn6viiTI0tyCq5zUVjBpJX7+zRrfgtNHyNvpHpCN4C36UoWx gWA1qL9dO+dk1702J7JP6ja3zutL0TmoZZM84TWpgpMYgLetKGvys1TcAPx8R0M= X-Received: by 2002:a17:90a:db54:b0:2b6:3034:4ae9 with SMTP id 98e67ed59e1d1-2b6ccd6bceemr16825092a91.35.1715891329488; Thu, 16 May 2024 13:28:49 -0700 (PDT) Received: from ghost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2b671782dcesm15524206a91.53.2024.05.16.13.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 13:28:48 -0700 (PDT) Date: Thu, 16 May 2024 13:28:45 -0700 From: Charlie Jenkins To: Conor Dooley Cc: Andy Chiu , 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 v6 03/17] riscv: vector: Use vlenb from DT Message-ID: References: <20240503-dev-charlie-support_thead_vector_6_9-v6-0-cb7624e65d82@rivosinc.com> <20240503-dev-charlie-support_thead_vector_6_9-v6-3-cb7624e65d82@rivosinc.com> <20240516-grandkid-monday-86c698ca4aed@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240516-grandkid-monday-86c698ca4aed@spud> On Thu, May 16, 2024 at 05:24:25PM +0100, Conor Dooley wrote: > On Thu, May 16, 2024 at 10:00:12PM +0800, Andy Chiu wrote: > > On Sat, May 4, 2024 at 2:21 AM Charlie Jenkins wrote: > > > > + if (elf_hwcap & COMPAT_HWCAP_ISA_V && has_riscv_homogeneous_vlenb() < 0) { > > > + pr_warn("Unsupported heterogeneous vlen detected, vector extension disabled.\ > > > + elf_hwcap &= ~COMPAT_HWCAP_ISA_V; > > > + } > > > > We only touch COMPAT_HWCAP_ISA_V and the failed case only turns off the > > rectified V. So here we have nothing to do with the Xtheadvector. > > There's nothing t-head related in the tree at this point, so doing > anything with it would cause build issues. > > > However, I am still confused because I think Xtheadvector would also > > need to call into this check, so as to setup vlenb. > > > > Apart from that, it seems like some vendor stating Xtheadvector is > > actually vector-0.7. > > The T-Head implementation is 0.7.x, but I am not really sure what you > mean by this comment. Andy, the idea of this patch was to be able to support this binding on more than just xtheadvector. You are correct though Andy, this is a problem that a later patch in this series doesn't disable xtheadvector when vlenb is not homogeneous. I am going to wait to send out any more versions until after this merge window but I will fix this in the next version. Thank you! > > > Please correct me if I speak anything wrong. One > > thing I noticed is that Xtheadvector wouldn't trap on reading > > th.vlenb but vector-0.7 would. If that is the case, should we require > > Xtheadvector to specify `riscv,vlenb` on the device tree? > > In the world of Linux, "vector-0.7" isn't a thing. There's only 1.0, and > after this patchset, "xtheadvector". My understanding, from discussion > on earlier versions of this series the trap is actually accessing > th.vlenb register, despite the documentation stating that it is > unprivileged: > https://github.com/T-head-Semi/thead-extension-spec/blob/master/xtheadvector.adoc > I assume Charlie tried it but was trapping, as v1 had a comment: > + * Although xtheadvector states that th.vlenb exists and > + * overlaps with the vector 1.0 extension overlaps, an illegal > + * instruction is raised if read. These systems all currently > + * have a fixed vector length of 128, so hardcode that value. On my board with a c906 attempting to read th.vlenb (which is supposed to have the same encoding as vlenb) raises an illegal instruction exception from S-mode even though the documentation states that it shouldn't. Because the documentation states that vlenb is available, I haven't made it required for xtheadvector, I am not sure the proper solution for that. - Charlie > > Cheers, > Conor.