Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp535089lqd; Wed, 24 Apr 2024 09:22:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7RKMpttEy3wkOcd+v52S5okiO5y4Ac5HDD4LLCtY/zkQJuKP4v8mC0LaNiBULhe2a6PdkUYuvC7J07An7DNUOOFJMwmhSe8RdGuGCGQ== X-Google-Smtp-Source: AGHT+IFrtrdo/QreWd2cStRcv3sY15sjoO/4ILfzL6oXtm8QwqOIxbMfz/jSJ83MQy3A2kveJapt X-Received: by 2002:a05:6512:358c:b0:516:a115:4a4d with SMTP id m12-20020a056512358c00b00516a1154a4dmr1853606lfr.68.1713975776195; Wed, 24 Apr 2024 09:22:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713975776; cv=pass; d=google.com; s=arc-20160816; b=OTgjhj0pCps2UOC3/3JEQCJ5Evsq60HrTZuUw/iMA6O+t3WOf2wclww9D9fGeorS47 rcdNkfDLF6Smw/XCM5ipLXaSJ2oR6IykkOL/TXEHgmiSX8dmrLZ/kBF3DZ9phCQdEpcI flcIDQL+/WsshtdLj3XGMb2BwS3lYxARyEpIZVHpkDciNpG9p+J0ps7+dXEASA+S3iM3 KsF2QBOcWu8MBtlLdvXLyXBoFz5odaSAE3HAy11eFCJudQxHPmXsCcaiO1CQl7j3dacG 9o6tuR0irnMIdLrYWrNU87VjYgDj0rrtvNOEvbnsKYUsngeTAa23ZUVOw4I/ET8X0PF3 3q0w== 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=s/mT8dYLNNDcBxpI6RYoMuqc0Mj6CDLobboyrOMzI0o=; fh=IUA1lykAl3wm86AZrs8nmX/CsboySw2hUks6CqdwWQs=; b=bAGnpnqrigra3TvyM9Lx+XEeWA3mzK1bWXL9PehfeEyo3mKsd/2XLCMDkEQTA2SVnD 7LnMag5/X5/uaMCzfhs1wUB8uVn4QnLwf5lFiAm2CtmK0fGpVJgpuO2X7QACIpx/jboz A/A8D2IUJqk15smAj3atpJ28XzkUHZKoyMHwdok4hrmYbms5eH//RkrUbQ65IkXwSb6e uEVnUkd9iyGOVtWdltKNgYtWG4LfE6EOBBCmyyyYfUTuWvLRYbpiQ5sfQuZ40EHYaxoA GOAJKR38Kut3Yu13htrYrvEN/55RkU+1hJ3n0zIuiEB+6oZ4FmTcMTjvFe5Xu7KKv1KY FjcQ==; 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=oV8Dn830; 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-157305-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157305-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cb21-20020a170906a45500b00a5555902860si8644843ejb.673.2024.04.24.09.22.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 09:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157305-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=oV8Dn830; 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-157305-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157305-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 48A011F26550 for ; Wed, 24 Apr 2024 16:22:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD525168AFD; Wed, 24 Apr 2024 16:22:15 +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="oV8Dn830" Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 C6110161913 for ; Wed, 24 Apr 2024 16:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713975735; cv=none; b=Dj6ymXJpvBk+9JjsgGIDEA22m7akgqSCr7D3Gkj0BiQV7zj9721CetTvZjydXg0kNr7LfCiyqrz2eUt51XUDA03eJ9H7TYAaOKHN+LjOFEKdCmeqq30Eft6MOBxrNsTuHNbB5ap44U5wehLROR7wPQso0jbIHF4e2x5EJhZlYHE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713975735; c=relaxed/simple; bh=RrP4p1oOkU3DSs5epOmV4/BbqCtTpx1t2NayPBKRDTg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xc9uK4cUAu8wuKt0ArEMa3IjFAe2N/PBOKMdDrnc+rRraqL0X2FO2tnZufrrudXVuj+hQoqJDDDRh7L1LgXIfIc0kacB4c3b1bzQNttsp9vBp2r5hPW8hRSGGRJ/6wtyB7B/o9OhhRpBtlXYEJocdDvQanYrqTM1KMReW3Yvmvs= 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=oV8Dn830; arc=none smtp.client-ip=209.85.215.169 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-pg1-f169.google.com with SMTP id 41be03b00d2f7-5f7a42bf0adso20743a12.1 for ; Wed, 24 Apr 2024 09:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713975733; x=1714580533; 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=s/mT8dYLNNDcBxpI6RYoMuqc0Mj6CDLobboyrOMzI0o=; b=oV8Dn830P4OOsx4GLDJ3RIfTAE6/pZrEyB3YurvFgUxWAa/cCNEDgUI7cOUm56Wcvx Fh1d/1XZhErLWRLU97GXj34CIuSSxwUzps1leUXppfJu4Mq603yTneOkej8oCkXuAPxs YWhfdZOOsoMq3gOG8QpLRctE4PNahXlqqIcqfzPzBYBLkSWcJfUJkO+JhVzwVCx8dbaR I+RufrwH5OGNLMXFajzjLVC/v3FbAGlkZn5urHR/w8vwaN2gXQZFhqfOxbpGWkKqmlNA Euvw/Hp6jFuDONBRBnvf+6O+3EuYELL7dOlnWk8o49kVQYTbexwoZpbxJyySmOwt9wGH H8qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713975733; x=1714580533; 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=s/mT8dYLNNDcBxpI6RYoMuqc0Mj6CDLobboyrOMzI0o=; b=aSYuFK2AwCCl/VXa2+vpVG00y8vT0d7E64XrWTnpX+SGjhgGIes4Zde+oCzhD5FJh7 Gx8vV9f7i2h8QXhBhVOEAMjTHNC18itSy2j7VoyNv2r/jq9HKNmCASfgdYKStitvcliY Y/TBTDhmSLx14p0HJHkon2wz7KVtf/nDcHHzHOPIxFGdqltvtIV35o1VyLkRjXpUkhoo eGpr94cBbsk0+7zfRXR9F6ciY6MNEMwrMUkSlfW+QLNuiA659FpaBK9LMGL5bdp1DGRA Bs/rnM8ZTx+wNJhWnX6WQwIGLe37xW16CAwzSbnjvO0dK5fnXseA27ou01q8VoAIIzNe ZmEg== X-Forwarded-Encrypted: i=1; AJvYcCUADhky120BwwSIzFH+SbB0iiVqRsGfJwKklMpFE64acEblC9K38UiHSkb6qJQk8u5UAUtM3ROkQ5QtRCQDjH3TzqR7gKY+hiaCRsUi X-Gm-Message-State: AOJu0YxijvYKMiZPmT0D+5nmJdW4kwp4F3v7U2o71sRHLmaT8X2fLM2d hBwWdd7S6os1wYDf8r45gBhbZ/h/cg1J9sdLhSbtYPY0YWZdXNzcWCIFtwMwE/Y= X-Received: by 2002:a17:90b:68b:b0:2af:3088:e36f with SMTP id m11-20020a17090b068b00b002af3088e36fmr2212404pjz.7.1713975733147; Wed, 24 Apr 2024 09:22:13 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id s8-20020a17090a1c0800b002a610ef880bsm14505760pjs.6.2024.04.24.09.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 09:22:12 -0700 (PDT) From: Charlie Jenkins Date: Wed, 24 Apr 2024 09:19:55 -0700 Subject: [PATCH 2/2] riscv: cpufeature: 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: <20240424-cpufeature_fixes-v1-2-585e73d2226b@rivosinc.com> References: <20240424-cpufeature_fixes-v1-0-585e73d2226b@rivosinc.com> In-Reply-To: <20240424-cpufeature_fixes-v1-0-585e73d2226b@rivosinc.com> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Conor Dooley , =?utf-8?q?Cl=C3=A9ment_L=C3=A9ger?= , Evan Green Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Charlie Jenkins , Alexandre Ghiti X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713975728; l=1120; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=RrP4p1oOkU3DSs5epOmV4/BbqCtTpx1t2NayPBKRDTg=; b=fykBMmNYGQRbdKCnZBCBpAC7r/ZAcCVj+foxhpZYBt1r8uQQCIiAPcxCl/E79KO5e4NqinaiQ KxWiqVn4klhCdrNlU6ZGZ9F6O2RPTasya1RqwpiCLfDAjqIoRlwDu6r 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 Reviewed-by: Alexandre Ghiti 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 c6e27b45e192..6dff7bb1db3f 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -607,7 +607,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