Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp995481lqo; Thu, 9 May 2024 01:17:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWL9goi0D/VxNEDVN+13nXYqQ4A+2iPija3Irn/VdqoFTeZ+CuM03/fEmshk3TrHCzI8+fSD0QW8LMTrcmsx3m9lsOLVWV3ZWs0orQBOg== X-Google-Smtp-Source: AGHT+IGGW9BehyRWqm7J2UN+YcBN7u67u5YVHaTzjfgz9x8Lr0NTm+mQ1XMQeSFUsi9pTh9jAUIM X-Received: by 2002:a0d:df83:0:b0:61a:fc3b:fdd3 with SMTP id 00721157ae682-62085b248femr57196327b3.43.1715242674838; Thu, 09 May 2024 01:17:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715242674; cv=pass; d=google.com; s=arc-20160816; b=mzYEqsO8vbXEgL+xKBjsstOK2lXrSfBXXybhlXaOpYVV5LFEY4VnNMnV87Pg67lfil mXcAwYsXqA4eMCVpEZCqIEJAx/OI977a5A5Lsn4dH+MxYvyHBWK0oeZvdDWLjsWojlQr THwiFQt+vS40UJX8tn1SP5LxCgDHcw2j3Sa8XkShocAvsv27ZpkaJTvKPbaPB7r2eEG3 sCbwvH8tKPPqj7YETFMjLm3XtO3f08rD5KSJnrl0AnW8TO73omkibg1T9j0rAZB3fHco JbneVToZaAINAzOPwPSdPT8gNCQoBH1VsZBEssR4JRhgRb9sZGbAYSy3ISWQVrgCX/fL Gi8Q== 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=kjnbmEX48U1JO15QrxlLa/6dXpyKAiiSaxAUFbbJQO8=; fh=4jyGPlIgBC+cOBl2betKVRRu896Cfe1VEzAQNc3FCOU=; b=pBUtcScz+BeCfEwapjkpFcsYMexJOppkprJZCbryi4Xo181lIZO2pjXGOMjtN8JC+/ gDLUKQkcv3p7AF6gObhS3du0HoGBK+YUPGJx4alT18reZb0xxdk9NMw+F4A2RwYqLY4d uHL4Jgs3fVASaO+1kWd7CTyNM+8dzpZudzoD9MfJytRYXU17HrAwaDGIWa/wOxPQZ3J5 CFF9fHHkLKa7zbXfPrFmzwG7Dp2SCtlCJ3octcmw37O4NrE1Mts1K+7cn/iDBbJgfHJf oRwEoroLbKBU1DIY3KUcAvpeheZaffHsmVzhuEG+ArsHfDQPY24iTHUppKvgufJarihW eDBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=AZUB6qGS; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-174273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a0f9asi9162541cf.32.2024.05.09.01.17.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 01:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174273-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=@microchip.com header.s=mchp header.b=AZUB6qGS; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-174273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com 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 799C01C217B6 for ; Thu, 9 May 2024 08:17:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AF9D1494D9; Thu, 9 May 2024 08:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="AZUB6qGS" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CB5514A097; Thu, 9 May 2024 08:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715242659; cv=none; b=e9cLLxRzLiE1AwENWxIJo7INezKePmCadNHzRuW9BR/FsKKpM9WiDfgDgLSZbwfbOK+bgJjww0OVZrOYiegdZGRooXCETBDg5kXRgYEDfeMlg8C81XvQjtLUHqPRA2wI9F87Ec3OopWcZiPd96n0I6gkECS7UpqPL7moA2RxqNk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715242659; c=relaxed/simple; bh=lMaYXea0/pL6iEr0T3fEYaeD0BO/p+aXtvy3hTqRvxI=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kbh7LLR62n4O7ae+2OSSAxD0UTCi1RoH4fdagB9p2W0WZHHzUkhFyFH/7bpGB2yYBcY7V9dG3Qw1tYrnPN0TXyzupN7brwOvIQnBbywbLugsroAwNPIH+4FlgkmmH9LZ3OcpZSZAxmRg9ItWOZExgohxfSPo4PfphHZpZR39RcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=AZUB6qGS; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1715242656; x=1746778656; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=lMaYXea0/pL6iEr0T3fEYaeD0BO/p+aXtvy3hTqRvxI=; b=AZUB6qGSZYcgcW/c8X1Bb+pHRm2EZk+XUjUcPSje9xqkhq0AUDCDRRQB 5NrO6KtDRBFcLFqRmDQY+lbzZtQP+VPulxmFsTycoIoJevMxORq0TSKIu Ae6GjwwurjyXFXM0cEDSK0om0GDY1bHO8XbgVmeeJMItj8VP8/OUPxjTx MAdxX0okqu9Bfg2fduW6cDj9hhUzQXL+ikEXE/9VQBjc1rIlpj8a3GDUr FjngvC44BTfDPDyH4CK/72CBf7dFPBmUfpbR2GnNpuRwCMyiwP6qC4pMm pFKyZwt8yozeor6mOehDCAXJXpOhaSB1/BX8EkMMS13fHRMDWaVlZMfJs g==; X-CSE-ConnectionGUID: 0mKwrjsVTF+mfP6kb6VBzw== X-CSE-MsgGUID: w51U2VCEQquHoJanXOK8gQ== X-IronPort-AV: E=Sophos;i="6.08,147,1712646000"; d="asc'?scan'208";a="26482894" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 May 2024 01:17:34 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 9 May 2024 01:17:24 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 9 May 2024 01:17:20 -0700 Date: Thu, 9 May 2024 09:17:09 +0100 From: Conor Dooley To: Charlie Jenkins 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 , , , , Palmer Dabbelt , , , , Subject: Re: [PATCH v6 03/17] riscv: vector: Use vlenb from DT Message-ID: <20240509-quickly-nibble-01cdb4e541ee@wendy> 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ftL9clxrsKa3hb4u" Content-Disposition: inline In-Reply-To: <20240503-dev-charlie-support_thead_vector_6_9-v6-3-cb7624e65d82@rivosinc.com> --ftL9clxrsKa3hb4u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hey Charlie, Just me being a pain again... On Fri, May 03, 2024 at 11:18:18AM -0700, Charlie Jenkins wrote: > @@ -671,6 +713,11 @@ void __init riscv_fill_hwcap(void) > pr_info("Falling back to deprecated \"riscv,isa\"\n"); > riscv_fill_hwcap_from_isa_string(isa2hwcap); > } > + > + if (elf_hwcap & COMPAT_HWCAP_ISA_V && has_riscv_homogeneous_vlenb() < 0) { > + pr_warn("Unsupported heterogeneous vlen detected, vector extension disabled.\n"); > + elf_hwcap &= ~COMPAT_HWCAP_ISA_V; > + } > } After replying to Andy this morning about doing some dependency checking for vector-reliant extensions I realised that we're actually doing this check too late to be useful for that case. Say for Zvkb we want to check if vector has been enabled before marking the extension available, and without Clement's series that re-works the riscv_isa_extension_check(), we need to ensure that vector support isn't gonna get turned after we've already marked Zvkb as usable. If we could move the riscv_has_homogeneous_vlenb() call before probing extensions we could then examine the result in riscv_isa_extension_check() for V and make sure it doesn't get enabled in the first place, rather than clearing it after the fact. There's a whole load of moving pieces between different series here at the moment though, I wish some of it would land so that I could send some cleanup patches for what I think is inconsistency on top :) I wouldn't mind if this landed as-is, it's still an improvement and the user I mention above doesn't actually exist yet. Reviewed-by: Conor Dooley Cheers, Conor. --ftL9clxrsKa3hb4u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZjyGhQAKCRB4tDGHoIJi 0u56AP95eBVgYwPh58UnZa0lZuyLzeDG6PlD0hXLsOA0eWnxUwEAqvt6X42WuHh8 3JcdzsXkKeCVaTmE3NYKMOyV9FDU3Q4= =JxGW -----END PGP SIGNATURE----- --ftL9clxrsKa3hb4u--