From patchwork Fri Apr 12 04:11:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13626801 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 84981C4345F for ; Fri, 12 Apr 2024 04:14:11 +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=Dyz7ptTzr97ynp0i0BHnabRpiF7o78drK1vPJ66Ccmg=; b=I0QJZlVSGaSiLg pXXVOgAu7re4meiOV+JjPIt+pBHT4K0T3tYOPWlUucFwYuiYccqsZDj3wF6g2md5H0hRc+4RQjrDB jN2NtxTuGzLoxn4AXqbMl9McCdnE720aiTG2V0r9anAxo+yXVrh2djbzpJZGKS2K1z8LcqMkjEqvV 8A4/dXTMRColIQAqtrb0JeqAZsyemj54pDnlFqdWmnioOkZAyuKb4TQbLRDy0Fnk3JgAEuRDpSDIB 6zxJZ+dmiocbLvbtleWJFUTUvCin3oIJ6w/SnOVsK8hFPABHUuO0K5Zhzf5XqxJ/qYWaN2CZeAFH2 gDiBSbOIpr0drHPclm9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv8IW-0000000FC4T-3yl2; Fri, 12 Apr 2024 04:13:57 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv8GN-0000000FABy-3ASm for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 04:11:45 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6ecec796323so556440b3a.3 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=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=wB7ZUsYFAipUnqatnSlT79/6WrFmpwXquit13SzfcsE=; b=pCFohwP/pKWUdym0eW8DTZMKccjSaY/OCP1uqi830phi/fDKrYzpoa6VsxeieBzfs5 Mt/pa2p0kJQUXwgMLDtVtwPrgC+MH/BrsgO+hD5nDpLLzkGlCJXye3AbTzI4LbP/umPR X0jP7Dbad4wWBV6r1RtIznwk3CajeFhcF9zldg85vhFQQc93tq2dKcYOLX/PQuO2491B 6P44zrpHZUmZQJFfJIw2zrGF3fDrKl/SdAx3BZMO7czdEIjf618wK2QVPd9aTJiKUxj/ B3ZdReQgjPdIFlfSMLuPBHplQDePh15r5ARmDWZzjCP1IsqzOVMdR4UD+4PfBoaiZn6a nJSA== 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=Pcooj+GYtrQBpm8dfaWhRhDN1XW2CYYpAAhHgxjym9laTI0QwsQWowbtbySK7jCeWr huj3d5T32k+hQWjX1QEfcbPz+Sh+kHDRwuEG1kpIuBEmxTuxSrU6VdefKnwU73zucwD9 LBBiv5B2GDSPzWwhpAEO/wII6ed4yrLlJLOukcPphcWDw//c1J95vLdPHPeKXNlIVeLP AYFtChn1W7j3oL6EbUp3OtgM6fKwglB2pjdLv257C0X0vmndAkHxMgJBUf6Kk/paUxnI 56QBb6GgJg7mEXJ9sN5fyZftbLt9XrTdacebcNNZhoN7NP9yZ+dm4wv7j3OQVHFiVozY Qwng== X-Forwarded-Encrypted: i=1; AJvYcCUnCA9E8XgbthLJznvuf/OdBLKFXrzXET/fJMircZR1hfhCQMVR/bZGCs0LpHKFlRiMp+olHahj6vg2Ix/wJTFxN5uSbuWjYlyk/aeWnYiOwZ/fJlU= X-Gm-Message-State: AOJu0YyB5CV1nVr9u6rdFjtj4Oj8l98k9w76C2wbkcLMIUUZLXVsfA4S vedfZfxLdr45003JDLFJbrtmJQKDt+HGp5EYhISWZEV0vh+Hle63Bhj3q/eQ8RM= X-Google-Smtp-Source: AGHT+IEbXTdjwKLaPoBheBbgei3pXYbfSWchIDinY7tvcECrUoBINHI4reVXQnWJo28mfWEnV9kXkg== 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 MIME-Version: 1.0 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?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=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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_211143_982902_24226E41 X-CRM114-Status: GOOD ( 13.44 ) 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 Fixes: 0d8295ed975b ("riscv: add ISA extension parsing for scalar crypto") Reviewed-by: Conor Dooley --- 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); } }