Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1565694lqm; Thu, 2 May 2024 21:52:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWrLK800JykVz6Ga7VVzElRa8Y+mTS0kE3uiquNXcrkUnsSD5/mpTFLSIDY9MYn8mMJNHNY07e3dYgqUPas21FxHSk3K4C61M/FzOVpg== X-Google-Smtp-Source: AGHT+IH0FBkeWO5VLvycM1uXmZHh02qSpbG6aUmhGSHR/ncmasyel+8z15lm4HYu/9bjcwqiwcC4 X-Received: by 2002:a17:90a:b881:b0:2b3:2a3b:ddeb with SMTP id o1-20020a17090ab88100b002b32a3bddebmr1920422pjr.18.1714711976593; Thu, 02 May 2024 21:52:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714711976; cv=pass; d=google.com; s=arc-20160816; b=r4pPXRrTo+4w52pF62q0Ehh8qAUPrvcQS+ndvZ9r84VDMsfXHS/+Vb53feiychoOlg 9pMOKNkak27pfgE5b64aq03z1wrsClGJ8yyYL5T6J10mycWwrEKiB7BiP1HOKQ15bvba 6l/YRZyVwPLOcZCff+mz7HNjW5FRl1FuJFvN5MukSNanZJgHucp6SQGYQeLudguuk9kS 6gFbf2qPNUczJxigYxOJtHLLh4769yGHPmzx031b7zeWpKW2Q5hyyQKMkZJAoCuawFBS tGdr+0N28kx6Ax7MgCcsausSzTkniw+646Fr4plKPdmOeOZjYr55CtYo8rtZC+GCmAro sd5g== 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=vtwC5CithaOsyDnX18EUQqmgLnixhsZn53ghod6HD4Y=; fh=5lhoka1RqepEy8R0DMFroq47janN3b9iGJsKqEPsmy8=; b=M8l3yB7Fw+4XMP16P1TNgvNISF3s1zoWAW19qV3LlkRoJLXwQkmJerUjLos49dba6w ekxN2zsDQfISdZfLqmzFBKH5BsG6wqj9QnPkmShXabZxZULDKjkwxq8U7xgXBw41JSd+ e0tBMOw0Mel2S09kTaqniyg6AxZYQdJoJDPblcKbg88eNGlQCbmOYeuDKgvegmHeu1+x BEQyBuxfSbIsQx7sDm1HlUvSrilmsXHZPTbavy6e3lX0qtvsRd0HjWSAkogF81S+DJWZ nnJJL7LbYN6cQluyQ94qVCzDPqgNrWCab7rNZjoWkpXe/WIZRXdakD/Z46jJsSzpMUkN BA+A==; 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=A0fmQPTw; 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-167251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167251-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q98-20020a17090a17eb00b002a2c3529123si4607037pja.184.2024.05.02.21.52.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 21:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=A0fmQPTw; 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-167251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167251-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3ED1C2843ED for ; Fri, 3 May 2024 04:52:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EA3613A272; Fri, 3 May 2024 04:51:04 +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="A0fmQPTw" Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 673D813A256 for ; Fri, 3 May 2024 04:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714711863; cv=none; b=ee0GMB8wl+4HEj9wYBc3G4iQNtVsTpwKoYgBgnRh6uX6MuIztx2sNTIIEBdxS57p/Xf0OpX5fpjIE8f6KmtkNzpZuiGVzmEcW8RebS27vvQJMH1bmS2FouVPSNHRAhwGQBBuR56bCLTypTKbWwAft7kgvF8PFwnAFo38vkfxvls= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714711863; c=relaxed/simple; bh=aClvRhkni8+VngBib+tXbyLWgA3xiyhnWY6l4lDY2FI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gjbt1jXnRyWmgrOIengGMHepV38fHNQ5Z5lrF/t6SeK/+JyRPxY5khrOe71uehdPDYjYa88ZF9a2w433zt7zZ3Lj/nWVUxPyA8TbCwQB+2I2SVuwBcysSin4UnGBKqbjF4OLPPgolabWM3qj3fUIcfSrmEO4Mvly/if3LzuTwr4= 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=A0fmQPTw; arc=none smtp.client-ip=209.85.215.178 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-f178.google.com with SMTP id 41be03b00d2f7-602801ea164so5967629a12.0 for ; Thu, 02 May 2024 21:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1714711862; x=1715316662; 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=vtwC5CithaOsyDnX18EUQqmgLnixhsZn53ghod6HD4Y=; b=A0fmQPTwPQt+hnzMkhsdI3xnEzBKHGTojDsdY/fbRbDd7GKLkJhSHWBqC58JmIbtS7 RYxEjHs7JmLrG37VRrm1b/w0hxO4NgxkdvtyqdvKkuw4LmHUbX87XMx/UOzQlDiJ8UAB d9++7nkaodKJ3aGkMIrwvaO+GQCi8RJ6xj5x7OL9NMMV7YLTraiQ1xY8J8/n6GMM1ra9 vUeJQh1/2bOD618IwKpfDwW6o7slbkVqBRy2VIO+hPMzaq9+gE4AaYqobaPulWoPkibV GG9jJYc5Rm3PP9hTxeA1wMLgHs6vkmCWcsbAO32qyEagZd/s2MoxTAmtfpoo43+btKkC Wz0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714711862; x=1715316662; 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=vtwC5CithaOsyDnX18EUQqmgLnixhsZn53ghod6HD4Y=; b=HosSaWHEDQkxnjxMuaQV+GFTvfgoR+YKEyRKmyHNgsX1jZWp3ULZkP7kfkxOqgdjJR uFjMqWs0BQDt0USUq6/J6XJmlBZx4gQA09fkmSSs8kfFbs28ER29syuGWRxGW3unKleZ hhN8UnJuSSGwusYH1VRsdb3gUoHfBaqUfQ1Q8TGu35zWmeqGZFdxYwrnIAUJPskIu7XU ZOX9wtFnAyX902X9uwPQmAcSB1QjMd91OWH9D1Dej9XHGUkQqVdXsJUfi90vqE7KMYJq i5sti/jeKgmxX1TAjH0zuR+0TDjqQHrRgRgrqdL8FZxsaRnCWyMJS1DeFpMwngWVX5G0 LAoA== X-Forwarded-Encrypted: i=1; AJvYcCWutdNhmDTCER7zZdPqapfmnb3iKQ+jJ/85gwyJy6KM+/VpJ0gdJv8U7azKzJO+KHDysxx7Nl0+BsMVKsX9G/7m3QZFUuJyKFWX4sJZ X-Gm-Message-State: AOJu0Yz2T+j5gRtbckwSEqTgL1qfOgxN/DA19ahj+PSsie1KphFPQsnC T/aX4LZYRq28CsmLV5unm3qnhdD1sT0dAhp98Sp5nhCDYiXlXToO3CALAGs8ZVs= X-Received: by 2002:a05:6a20:258c:b0:1a9:ffa0:d007 with SMTP id k12-20020a056a20258c00b001a9ffa0d007mr1997150pzd.58.1714711861757; Thu, 02 May 2024 21:51:01 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id li11-20020a170903294b00b001e3c77db2aesm2276384plb.88.2024.05.02.21.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 21:50:58 -0700 (PDT) From: Charlie Jenkins Date: Thu, 02 May 2024 21:50:51 -0700 Subject: [PATCH v4 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: <20240502-cpufeature_fixes-v4-2-b3d1a088722d@rivosinc.com> References: <20240502-cpufeature_fixes-v4-0-b3d1a088722d@rivosinc.com> In-Reply-To: <20240502-cpufeature_fixes-v4-0-b3d1a088722d@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 , Andrew Jones X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714711851; l=1173; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=aClvRhkni8+VngBib+tXbyLWgA3xiyhnWY6l4lDY2FI=; b=gwRqVJm01uxvkdlrQKBBOn3dquKs2d0HbChFUuQQkjkWjU4Pgd55dBFMK5u5tp3XbrAvXtJiV gG2bGvn4tcMBAHUDeEUo4MTq+EhGf2AyyVTIO2ihJ6xqFiTuHUUJ79s 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 Reviewed-by: Andrew Jones 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 13d4fc0d1817..5ef48cb20ee1 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -603,7 +603,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