Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1476634lqt; Sat, 20 Apr 2024 18:06:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUv7/zZZCs7NXjmy/t6J/nUmwQPLNJxl7V9XbuQYkPAbgdAtCQROMhn9evuRK8g/kiNcTWUmEiGIgogTeUjV+QeX9cDdoqZ2cdHaY8upw== X-Google-Smtp-Source: AGHT+IEsbVnT9I42+HVCm8ceGCM9nk2X9zj/57Zyf34hc5b7OTdQzy7/QjsavoPYA+50Fr2h12t/ X-Received: by 2002:a05:620a:1903:b0:78d:5d7c:9896 with SMTP id bj3-20020a05620a190300b0078d5d7c9896mr16031415qkb.36.1713661581526; Sat, 20 Apr 2024 18:06:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713661581; cv=pass; d=google.com; s=arc-20160816; b=jA0WPgse8B3vMrvhZ8TtlQI2cAFN7rx85jQ5F+bdQ8l1HQGC6EX/37poYTiWzXQU5l +Ltzk4O/Lb1S96wwfsm4JRCQcHwv6rzFF1xv85O/HMt1q2+MFOOyMkUNKok4NwKnOZWe tNFJrqm9B25kDs8wL4jyvSdPDufFpMp1570SwJwks3P7sGwI7+dh637+OPgltqcGAf+v dbyBqs0ObeV/KvEEqL0XTnRIfCa+t7uGm0U4Ifwj04XdDcvQZha3+Yqtis5IuQ+rKMEI I9xo90/wnFivG9QQWjyhRh4GYk78Wvt7ik/eBUTC6BgRxIS4BZQ2n525q9Rlm25sJxBF rzlQ== 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=Yu9Am0unYXzuMc0qIjJPUdYEG2xZXFr099jsPQEasY0=; fh=CIwmPTEacfme4YrvU7F9f5dvaiii4AqtLCZjxxEo0hQ=; b=d3vxZcVAwpCARUtifJh35uKAf9XltlzF2ngmX1KaRWBi7YO003FhlDgnuqKKHtX6es J5pQvGVexjz4e1C/rHJfES/hv3A3UR1O3yO+fEQBtayK+hvtHKKKNFY5j14lHZJ+It+z ujLy1Bx8ye/h5cPD3BVRaR7rtWYy35qyg0SdZurTdqOT/hHw2xcxYRh+4ETcoSEo/qjL dJbyStXDelfIlpWprd1ADqhw6OaFEBnW+kkAJEP+a3vPHfqcXDGe9GdUcqQfNv3cSMx6 RVN7E5caIfQtVW3r6CPgrExYm+LzFyFXOA81kMyWIb7VY/Ioy+li5EeuaeKjp75Zg6GI 6h6A==; 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=oGccmBvY; 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-152409-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152409-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k13-20020ac85fcd000000b0043980bbdb27si1621195qta.73.2024.04.20.18.06.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 18:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152409-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=oGccmBvY; 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-152409-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152409-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 4546E1C20C3D for ; Sun, 21 Apr 2024 01:06:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B23DC14AA7; Sun, 21 Apr 2024 01:04:59 +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="oGccmBvY" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 919C21119A for ; Sun, 21 Apr 2024 01:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713661498; cv=none; b=tsDhdbqcHjj+nopucaRXt0UVwB9i2q4n8N4l+vGwaa7MGHp7uaCvfWseZQTBjXU40PPAX4QVTEnktuewUx3diAsCBM2unVogpN09FqF03fDkmY3CQqyTIrinSm1fnGghKfxrGgbJqo+smG5/ww6WxFnjcJUXshuVEHAqysRrBBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713661498; c=relaxed/simple; bh=QiQI1i7vjXBhs46HZcfDGYtUbq5szs9hkhXvkNVDIxw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Otm4pNWdP7iLRe5UsKUMMzQk1y7AM8BJ4AzTpQB6LARvuFygBYTwqJqAUvqoTBd9I04cK5NnR1HAJJpzDol52D6WHdkV9qaZMw98olS8OipipyM0J4NzQLdegqo9lvUER2y1k8NQUgbUd6I+lrzOyTVdgfKG7KDXkPR55/jI0pk= 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=oGccmBvY; arc=none smtp.client-ip=209.85.210.173 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-f173.google.com with SMTP id d2e1a72fcca58-6ee0642f718so3065900b3a.0 for ; Sat, 20 Apr 2024 18:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713661497; x=1714266297; 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=Yu9Am0unYXzuMc0qIjJPUdYEG2xZXFr099jsPQEasY0=; b=oGccmBvYajcLj/QmiK9SQgst1zVxPYLUJAQsQNkRlcZZJIul8UICE///c/FFFzQHT+ 3iX1sKSgime1oqwvYNoiayEj06ljrr0hP3nQvdWog2cypsKo0qD2SB4MBMnwnHerIP8S yenzo5pq+JBByPikyl0a8inSPAhxQjV0zPAK7yVQFHKOaeOsLyIIOuu1dxVSbkxZAKoI mp2iIM/+E0P49MF238ZKrXDnKSNnF9RBrdh1RSHMn8TmHZxOBnHd97McGoZ5d635ifbh PxJqybJtaIVV4llLUjuTmeDP0ZG5EL9bV6esvhA0SNLSlJ/aIJxOTEx2EpIg/e1pAUHB 1VoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713661497; x=1714266297; 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=Yu9Am0unYXzuMc0qIjJPUdYEG2xZXFr099jsPQEasY0=; b=LN3ayJkexhTTSjzmKUqfHO9io4z68Auk6Ti61bBLDfAcg1mWObumsqGthSMNiJq1Jr 1Fs6Dusef2pdkfSeBVd8xjpSI4zzoioVjfCmXgKAW84p1b7DXFwzXIo9NmWiWHzYs4DW TxYR0xmYfm+Y4xA5O9ifaJYKUkYXplNeC83zHprBgPg9uJSdfnt7xvyPtKXOeIJIKB41 eqCWdrlXqQu0ckgIbYOCcYkiDkWeXAti3DBeoPxXSSB523+psI+eedEN4ql+PSPf/BXR gCr9RZtZa1rsxXqhsUIBCJMxhNB7mwGjS+htA0kqq1j4+xrBwu3qd7X29+y3srGPB9U2 VukQ== X-Forwarded-Encrypted: i=1; AJvYcCWjI1zmqx1ZKMWbA13HVYOe6PucrDZtwKXotX7+CVOomElCKd1A9VWJXtY/cL2T+YU3tUGG/z8vGBCbQwa777+jBLs8wy9LmJJrhaFN X-Gm-Message-State: AOJu0YwcYqAJJop0dvPWMDpZ1X75oAD5ay7ApV2Io77ZH2RjdbkZiBhg nnHj0J2mA7LELQcYh+MjSV/5efmhPPEuGrQVdFLBOjJZF/+qykKMt/n+wz1EOxU= X-Received: by 2002:a05:6a21:7884:b0:1ac:efd3:4d87 with SMTP id bf4-20020a056a21788400b001acefd34d87mr3420884pzc.19.1713661497028; Sat, 20 Apr 2024 18:04:57 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d6-20020a63d646000000b005dc8702f0a9sm5249627pgj.1.2024.04.20.18.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 18:04:56 -0700 (PDT) From: Charlie Jenkins Date: Sat, 20 Apr 2024 18:04:38 -0700 Subject: [PATCH v3 06/17] 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: <20240420-dev-charlie-support_thead_vector_6_9-v3-6-67cff4271d1d@rivosinc.com> References: <20240420-dev-charlie-support_thead_vector_6_9-v3-0-67cff4271d1d@rivosinc.com> In-Reply-To: <20240420-dev-charlie-support_thead_vector_6_9-v3-0-67cff4271d1d@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=1713661481; l=1065; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=QiQI1i7vjXBhs46HZcfDGYtUbq5szs9hkhXvkNVDIxw=; b=+3zc6q0i2BsAtbDQT7K3i0HV2YRODdQ7IkaZd+LvMW/ig/YqGy1avCBI4l0spwFxEKlLUSKKu xWM1me9URmJCN4CloLYVBR+5P4yAUklVAjXSfYEk8uxaiWkJDMFr8fd 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 Reviewed-by: Conor Dooley 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 48874aac4871..b537731cadef 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -609,7 +609,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