Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp212847lqn; Thu, 11 Apr 2024 21:12:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWC5AzdE/Wi0TOz1fTa3S2GB+NdF+QotT9hB2cw1lj9KG77b+7+JiF+bWP5o4EUxLTsW1S8cbKf6HrDe5S62jd7R4mPkP5gZJi/TZvuew== X-Google-Smtp-Source: AGHT+IFY0Eti0CoTYNkzoUOyYFtLlCBxNh4P+3LM4QcirdQlLWf/Oc10w8RdJpBWeLLrVW97DKJ6 X-Received: by 2002:a17:906:a84e:b0:a52:2b29:ac48 with SMTP id dx14-20020a170906a84e00b00a522b29ac48mr857472ejb.24.1712895178688; Thu, 11 Apr 2024 21:12:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712895178; cv=pass; d=google.com; s=arc-20160816; b=KrbAqBaeY5auQjej2bzm8MDdeXjyxUvk6PfxkEgEJL8S/vTwhBTDivGlpbMzPsroqF 7WU0/LlfL/CAd8n9W9GcQjlglOVqrQYG3ItnBYlnVqzgPlpeb6tPkVZgbJ2zqakvBEYC 5S3p0jPLwbwjPpOQJA+Qs10tjFOGhPx+7EYtksTpsmjEo+kTV3rcRHa3T+gOs44Q1JXb FrMiMMrHFKtBlo0CYYZBA70oesMhRnSuQp3BuHSwDR82mq+Nwva8hyxN35Gr814pmd5v wwXyuSEAw8ilyCmcBCwHKvPaLQwz1aJXSDk7ArA8v8G8hHgKZTG8SQ9OLHTy+E1TAv2Q 1NvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=wB7ZUsYFAipUnqatnSlT79/6WrFmpwXquit13SzfcsE=; fh=vD9RR37WxqIgzTM3PpNFpFXMegrZZkaRIFcJiojt6RM=; b=ZCuvsAH6hlc04KZhJUTv1kaTXbMSHOxioMUp8fgCVPuPkDH/kq/c22L9Anwmp4Q3UK jk7lVTwNTF7UWnzN7sUpBeJJCD8Dy9zRLNMJd/uwNZZz1uC/OzBTbI6ov3TNy9gDgpf1 yoHwZWftYY98S7j5emvU8u76BghuZHEx4gHoZDz53MIK1SCoOZi2+X/r/HnrQt12jUkR tF81Cn96nPogtzYQxFULVaiE0vcHw57kW1AXtld/1+HkEidvxemd8mcpqiGRYHiOzrBM ST8zwiVRvq5p51sPe88aOesh73DG5IeF5C77JFi8PP4S4qgBaGYmMJlA00Oe3ZgI0QNM ULHA==; 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=tf6s4Wj1; 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-141894-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141894-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 gz14-20020a170906f2ce00b00a52307a33ffsi410715ejb.949.2024.04.11.21.12.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 21:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141894-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=tf6s4Wj1; 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-141894-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141894-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 690721F2326B for ; Fri, 12 Apr 2024 04:12:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 990C83FE2E; Fri, 12 Apr 2024 04:11:45 +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="tf6s4Wj1" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 31CE11BC44 for ; Fri, 12 Apr 2024 04:11:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712895104; cv=none; b=c9FJKecz48qvxbgu3y8L6nXqN2vP/0XiRb9SMKQDF2tCZ6hjXgl67dhPun0PIwZLRajCThKchhaG71NbEnzM6QhyI4qsCBU8t/ZnXl2g2MpbDOqXJ9igqY2JWAkCDjmsBSn6Rd+TjuOHEqITYVFTlxEUrt7uLv3XdWo665h4Tyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712895104; c=relaxed/simple; bh=WDb56Qzs+x7qgry7ohRR7vfqZXbErIkQr8CN2awdr1k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RT5hLC0OirRpG2JFjE0nOGKtvQBXyyFxbtLbzAuWJ60Orb6CVOgq5IdvvsI9SjJlTxMCt+heHc70N5gNmtRspaCb4aEQpWR5we+jDPDGIg4f11BW1m8N/hSz1E33cwa7khtiXl6EYL0PzL2Nsnw9Cunf/7fvcdErTrgTeyh/0+Y= 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=tf6s4Wj1; arc=none smtp.client-ip=209.85.210.180 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-pf1-f180.google.com with SMTP id d2e1a72fcca58-6ed627829e6so532887b3a.1 for ; Thu, 11 Apr 2024 21:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712895102; x=1713499902; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wB7ZUsYFAipUnqatnSlT79/6WrFmpwXquit13SzfcsE=; b=tf6s4Wj1uBYyqO/XksWa7u28Xk4S3Qk0MyaZ/zLn9UhjU6sFGCWVYCEQ8DBE5T66UD HQdYedy5/rSJJhOoaJoVXELdUccSKOr3dEtPaysE/i6uF4gxPrlj6Gy2KvYGYXNpZuxW QFpZTgEcwatWt+eicLnuNYUe0to58/Mg7+kIresHo/4DUkMS5nCPGWHXC6ELx7xKMCir nkYSyIu2B3LUgUQFDnD3t8vADGKFl7f0u8wkjhBf7dCTAxVjtDM0e1YYvI6BuLslvo2p 211kQAdpzprT9VNHMuC15TZTbE4h007zXq+yKoub3olNGnd01Cp0ttYEMp7mIDRXaJCL 1CvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712895102; x=1713499902; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wB7ZUsYFAipUnqatnSlT79/6WrFmpwXquit13SzfcsE=; b=BKeOINde3JOktPQWNZcy/Y+ZmYxRfMv8WU/h9Pu6L+s3KuPzjK9EKViEc3Sr31yvdp lidSr+J3TZUHreBIowTQCqHee+LNd8j+jE+QeuUPGFN+gg75bm0xIkEOn+Kd5/CMASin yAEFH6++QRWGBUKdt4tpFKASOYXJu+Z4NeX1ftK6hQgi6URAkdAJGszmvCR1DM3eow6H AKnnpj5OzxuPog+grkYmL19XnOcNDCIfUkgMukqTgKPW3M8eUJ+TAg8MYA0XvIbpB6gu DEmtY9iuJYnIUihL8cLX4cQNwAeYjyvFy90cdmYhnrgTxtoGZZ7hnkLcmmjx9V1Q854B XkRQ== X-Forwarded-Encrypted: i=1; AJvYcCU0Wt6PhQfldQzec+4ao5ocAWWB/NBal6g+IWSGaWHbY4TZkbgM78TcwW7qIax0xtPw5N+iCz/Wh4Mhcj2rjWIsnaHgLr4jSeBBY46L X-Gm-Message-State: AOJu0Yz8htHMxkaIxz++7lTpl8d3BmspXvpt9KUHR7LQotkPudiq7cMa AedZnQsoMw4HrQ2HOyjjfGSL8EAf4Jte3gPeh65hLMQpR0IW1TgvcZyHZpjoCxw= X-Received: by 2002:aa7:888b:0:b0:6ea:bf1c:9dfd with SMTP id z11-20020aa7888b000000b006eabf1c9dfdmr1790213pfe.27.1712895102592; Thu, 11 Apr 2024 21:11:42 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id ka13-20020a056a00938d00b006e57247f4e5sm1949712pfb.8.2024.04.11.21.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 21:11:41 -0700 (PDT) From: Charlie Jenkins Date: Thu, 11 Apr 2024 21:11:11 -0700 Subject: [PATCH 05/19] riscv: Fix extension subset checking 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-Transfer-Encoding: 7bit Message-Id: <20240411-dev-charlie-support_thead_vector_6_9-v1-5-4af9815ec746@rivosinc.com> References: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> In-Reply-To: <20240411-dev-charlie-support_thead_vector_6_9-v1-0-4af9815ec746@rivosinc.com> To: Conor Dooley , 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 , =?utf-8?q?Cl=C3=A9ment_L=C3=A9ger?= , Jonathan Corbet , Shuah Khan Cc: 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, Charlie Jenkins X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1712895091; l=1009; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=WDb56Qzs+x7qgry7ohRR7vfqZXbErIkQr8CN2awdr1k=; b=DqPs9x4+xKLxKyU/GrR0haiJT1ooRWwhD1976AoD+11P4Z8zzQJKe+3G0zIGEYtipbwIx+Bxe QzUI0P7hfTcDieR1B1pNbhgYYul8C9wqM7AqldfpgtiC+2APKsFh8HR X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= This loop is supposed to check if ext->subset_ext_ids[j] is valid, rather than if ext->subset_ext_ids[i] is valid, before setting the extension id ext->subset_ext_ids[j] in isainfo->isa. Signed-off-by: Charlie Jenkins Fixes: 0d8295ed975b ("riscv: add ISA extension parsing for scalar crypto") --- arch/riscv/kernel/cpufeature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index cd156adbeb66..5eb52d270a9a 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -617,7 +617,7 @@ static int __init riscv_fill_hwcap_from_ext_list(unsigned long *isa2hwcap) if (ext->subset_ext_size) { for (int j = 0; j < ext->subset_ext_size; j++) { - if (riscv_isa_extension_check(ext->subset_ext_ids[i])) + if (riscv_isa_extension_check(ext->subset_ext_ids[j])) set_bit(ext->subset_ext_ids[j], isainfo->isa); } } -- 2.44.0