Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp140049lqf; Fri, 26 Apr 2024 02:04:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZIF7+q6cExrWgtJSP3fYadFfXShTdLOSZ+3KD/qjYuIjQpiyZY4C7x0cG4fIoRGUR80WUv3Q/H34KvtKRgugfCAK0ztXy5fUrhockRA== X-Google-Smtp-Source: AGHT+IGSUEIp8HRjpiISywOrWC92Mqa3tV2XWbtzAqeNffpr8UzkHiFk/v6CBJZRyC7ytcmRczYV X-Received: by 2002:a17:906:f8d5:b0:a55:77fa:80d7 with SMTP id lh21-20020a170906f8d500b00a5577fa80d7mr5165670ejb.8.1714122277613; Fri, 26 Apr 2024 02:04:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714122277; cv=pass; d=google.com; s=arc-20160816; b=sDfdx31Nj+72Jq1RW69rsGpwzg0Oh15e7SfPDusmx+a22Fu9wwJ3ETaGIMdX4OzrBy fwU6PvVV/WW+eEzFCwS9+f6vXBjSuMJcDvtReO061aoOXpAXOnse0VfHzlpO1jPr4/EJ 3Z0zMei3Y3s9rdEU/ThXqJK+Zmnx5S5NLSWcPZ84dB+DEKIc37xRFJ+q+bRzQUWtaesw 8pK41aA8SV6g2voc8kMehzZTZI2YgdgDYxJpaTcrtfTYSw2YtAELXs77aybb+ajEJDiv qM+kC6FDEPEXt4le4JXbL9xL7idYTRadPeB1QhpmwORlTy4JmBCaiIsNvcyuwc4GnuoA 7pKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hzl4Ufo8fPsUKZxQXQJoooQsy8g61GqJ67h+tl5OxfU=; fh=xmyT0AJ8fLSkFKhseoo0PDHKND4jiEIP3kYU9xXOiTM=; b=si7adJlQAMem75Fr5cwA5lWxuwRMLd+FNTNHN5Q7OMmdaa4ORgbU0knwB1A+TyTDLu hhIQr/pIWDbeHkFBNjseqOTO+WI/wkRcWfl5GsDV7+bxF5aElrxRodNrfkiKABCtaCkB 4bTtQqfcnvx1UFbskMZ+OmcAS9L4gxOAlL9yOHIsz7lPRPOPYF/4BUozk03rtQH6ivCD PYzQRkS25QFZg9v1hp8+3WW6FvAKs3LCUIG7Wuil1UsR8GLvpywOfSAKRQFpkJq5agF9 GpWgrotX4RY25lnarWwnEbRn1h1RkcnqDtInebuu7Imr7J19Y7soU+BRVNQ7nWUx17h6 wmAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=FpOERp8U; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-159739-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159739-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e7-20020a170906248700b00a53ed18788bsi10724826ejb.291.2024.04.26.02.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159739-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=FpOERp8U; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-159739-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159739-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 4F4E51F227FA for ; Fri, 26 Apr 2024 09:04:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC79E13D299; Fri, 26 Apr 2024 09:04:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="FpOERp8U" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 73F6225605 for ; Fri, 26 Apr 2024 09:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122270; cv=none; b=Tzv+P6IhK86eAxWtmc4PwFfkf4CmT//wPGMyilFF8QYkorAejrkUoPTHclqLWy/Y3fpR+vF2uH+2E+JpwLvbXPQPPxDgsfaU1S9iJTJR1Uaeo7pHqVEyoy8IMGACaMLAAa8/4vcHlhq0RzBNoet2IXuwOBvckCAF70BovvAtHJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122270; c=relaxed/simple; bh=nW7jXvCEvQnb9l7QOm8u/1qQtJrmGBsLapHtsNxqzkU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nY3iYQfj55QwuBF3agmjscaZyN4TFRVhc7WMk4DeBAYP4fCVoLiLEFMTTcvYwYFQikRB1DwlSJUX6oMLCww+MEih7em0U3Ntn+XMMaqEKU5GtIr7n+GfYWni65D2uiPO/6beZ3pyfntiwZ0IdCf4spvejWxbjjLVv4BNFCbjy/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=FpOERp8U; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a55b2f49206so518187866b.1 for ; Fri, 26 Apr 2024 02:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1714122267; x=1714727067; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hzl4Ufo8fPsUKZxQXQJoooQsy8g61GqJ67h+tl5OxfU=; b=FpOERp8UD4XvijQD/Thldx9fZbq4orYkU3NmEDsKgY94lI2MNkyMBMB9w/VSW7WdeP uxjVvzoPZvETVetc4HSFwGDAPeFqzZHTIitL5rMnqP8cwOnoh8LE6cXc5cfI8Sooq5oZ 0Ok4nVoDtanPFVchSGavhfOjAEzjXNBth/ysKKQB/dNeBkgXoM9bXFIU0RwPNNmiCDN5 6nTC75v9SamhC+71GO1E+L1ae5EBVOvW4mBL/Csuh51A2j2svLIpIUdZNyaYE0rlYW3p 53wcafWJUwGe58srp+czumBObuCnYEUCqVDQ6LrtkZcRYDZPxaOeRkRxBvjLmyTmolpd IXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714122267; x=1714727067; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hzl4Ufo8fPsUKZxQXQJoooQsy8g61GqJ67h+tl5OxfU=; b=YZmhS00kxJYrNIN1f3YYtAAMQZz86cgke/EbSsuZ9LQq/J4b5866Dp6QpLhUE0m3L3 f20GCfZSBFaJCe2Tto1OsotjefLAgGa3AldQT+yNf6L8nNZy/PTPkDLZ0yRjV+CsbADJ of4WHDqKKwLDKwdLddC2Z0xrGd1PEvS6cM85suuRZ2IguE0xoEYRCfGiAytNiX4k3KUt PiBhWefIh6SSVNZD9GayulxNdGXh5mb35sPFVEWFycLRgR+DJTgR3QEtxBIUxUoB+J0D 6QEzRb4dNdR0wwyug1c1VsIGLbk2ODSO7wFIMlrdQNHVGS19zaQMtc2NfM0rEhsDI9dE 6pJA== X-Forwarded-Encrypted: i=1; AJvYcCXFcahy1hrTueka0Ott+aH9wwhn+w3xa1lQVjsHskcAcpRKisLWhqSksbAHz38kV2mmi5k0veAkiKMb122n+bxoDe2FJXCracIsLzDh X-Gm-Message-State: AOJu0YzutSkWbGM3/H8ACNqM1mG5DSTN43B0ecTlRX8PmNW2cADxIfXL P/G4hMho3M755N5eAMbb6yklAdwZ4Jw8mvNlffRRDCiIt+sN8rR8Z5laOcbpYtY= X-Received: by 2002:a17:906:c10a:b0:a58:a0b8:2a5e with SMTP id do10-20020a170906c10a00b00a58a0b82a5emr2344119ejc.26.1714122266694; Fri, 26 Apr 2024 02:04:26 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id hg7-20020a170906f34700b00a4e5a6b57a2sm10343313ejb.163.2024.04.26.02.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:04:26 -0700 (PDT) Date: Fri, 26 Apr 2024 11:04:25 +0200 From: Andrew Jones To: Charlie Jenkins Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Conor Dooley , =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Evan Green , Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Ghiti Subject: Re: [PATCH 2/2] riscv: cpufeature: Fix extension subset checking Message-ID: <20240426-e532c061e4929c6e8babcb3b@orel> References: <20240424-cpufeature_fixes-v1-0-585e73d2226b@rivosinc.com> <20240424-cpufeature_fixes-v1-2-585e73d2226b@rivosinc.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240424-cpufeature_fixes-v1-2-585e73d2226b@rivosinc.com> On Wed, Apr 24, 2024 at 09:19:55AM GMT, Charlie Jenkins wrote: > 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 > Reviewed-by: Andrew Jones