From patchwork Sun Apr 21 01:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13637257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9C1BC04FFE for ; Sun, 21 Apr 2024 01:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O6cuqoPYI+9JUqIR9Yv5EygyJ7UqgOAlOs3NUZiVxdM=; b=2CTN77nFGOa9Xi BuSlaOrBrr0rOTh7+AJl/cSju87qoxAvkY4Tws4ufBCq6oRhJWw6S5ts8R0x/RFy7oiEzRDGz3P0L HJa1L00kX78UjUl9z3U9Vt0rmWyC+Lw71GwkSibI0ttgV0l4r5VqvaPDscC6N8Fz9deSIkyjbpdrT QdWwNKVsf3BzwAVsheu6gc9P67ygtxg1Y27EUHkLpATuLo75Lg+JaMfFfYdnfxnHKXFerUStqSNbI geaiwBSHxJa4C8iRnqws8lagnRu4ZyunMW1y9d4FrXxptx7TfPM/go3V5IAAMRXWffPJhAIZchiOL fjJpZ7RTJBEGBa43xAlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryLem-00000009Wjy-0cYy; Sun, 21 Apr 2024 01:06:12 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryLda-00000009VpJ-1mls for linux-arm-kernel@lists.infradead.org; Sun, 21 Apr 2024 01:05:00 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6f0aeee172dso1567268b3a.1 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=lists.infradead.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=pzunKNeaxCVelgKTrGv+UZZeEHR7AsQdqUdIOXDrCtJEXUEQIgufqX9W4ZuMe9oVq1 b07h3TsdZaOiqMq4qsY6hLLyU7WPh0rWo3/VoxyibxSqNft+JYSMssJjM5EfA0xXFIaT SmCd6eC84WC7/twpuQLC0lhZ51h5OrTKvpoBR0FbV4ggB+bYYO6QUw/MWblMvy/zhADN oFNg4awg0+4BghoKOTiODtJW5l9g7rkyrcw0eIkbZNDHcbht3cF/v7jICVF6FApGB8U0 faojhQleKWYL+0+gWnuCOPh/COcIzHMwmdfctRlwJ8aza3xK19oOMxR0J6P7pOjnRTzl Rs8w== 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=scPLHyK8mqJtlnLukoAutFeFA9xWFTkgrakOe/Qsgvi3BbE/sZfI1gyqHnFZlB9Rf0 3jKmrKRsLR1o78wnfbA8NOZeew0j3HnXRbnuZeIOHqRG39t+1eJVkyeRixdO3XN2/Qxh APX7ijlTP6OfV63FFKkJJgRdGraM7nHfzp7yYQYWZ1JfWZgnMh8mlVx+OM4gLf1Ifkd+ ohRT1OHI/XOTZ+PBrqkmHQFUgoTUaMMpB27S0sgXr3/POunIsxndOygxlQIrwSRtpn3U CnjTC7mSww5YHtKwhxV9Krb0/lwy4XdlA3mz6X62lgJt03EaQoU2AXw7Fw/NinKCiFuo 8URQ== X-Forwarded-Encrypted: i=1; AJvYcCWkINlzZPuYim+HqBakEhivkql8u1qkAvh/jqSOkckQ1V6heOSxL4laiz3c1nTOZ5m0IS8SZe603wM/GY+9NjRFfcTV+vviS3lskIDp3s70keJbXQ0= X-Gm-Message-State: AOJu0Yxrs/YyvsV0MRF2Y2IGBclXEoMxp1h0VC09mF3iR5aaVHJJd5lx 3l4Uw1Jn0UBY1UcfTfunLsyI5ABTTOXb7fSqETeUVS4EiOZzrQET/fogDnRotg+9KlcwjZWDaMv d X-Google-Smtp-Source: AGHT+IFWaA66MVhFHzVqeH6ER04Jg35UlWbtwP1v2a6tYCwe6/lLPPzjlT26aXgRHK+BXdqOBFuWwQ== 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 MIME-Version: 1.0 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?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240420_180458_584040_9F6FBDC2 X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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") Reviewed-by: Alexandre Ghiti --- 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); } }