Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1833540lqp; Mon, 15 Apr 2024 21:13:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUM0PQtR8MD5+Ku29yd+uUw0/c6wmCvHU8IYCWEPPpZpotaw4zMWHBTBTpvYeSv8buGY17sddqCnYHPOO2Ejk+jPwMnl7AHJO2CJqUZjg== X-Google-Smtp-Source: AGHT+IFwXM/4nWoCL7+rWkHFdprcxQJLH8I/YCn024dY+xk4EkNhHosGVGCoAq5+YkYs8qle8/84 X-Received: by 2002:ad4:438f:0:b0:699:4bcf:7d5b with SMTP id s15-20020ad4438f000000b006994bcf7d5bmr12963064qvr.56.1713240800337; Mon, 15 Apr 2024 21:13:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713240800; cv=pass; d=google.com; s=arc-20160816; b=UFyYpRPlJCM7MwJE+ttqsRCH2I/ZXwnHFxoAeNvHSt1M5A3xZ7x/GKmOGrNYtX92ef QrXBe/pidpGMNJ+ria3Khnw4TrjxFoIapZq1tEnjb8RVrTR3OiTBr2GWLDMFwPs0wKxF bBO2vXELyB2yToqJEFlRDb+1ZguTAsOLPD160akI12rfQvMjNzAHQjhzxylZLKwZfx93 Ep0VeVCdO4+Wog8N+CZpbmj4MhJoXQUjqAeCAvIsNavdCSwmRL1kk/cJBpvAXr+VZ0F5 vIM8lLLY7fxFmSkijYbAaY1u8UmMf4L3Q4yqA1CBMLnTAaQuCodb0HHKsXOtHolfMWIn wxqg== 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=uVSzHGFLNnrGti654VC11tvpK1bZGKmyJ0hbbIeQ45Q=; fh=4tG0492v9O0GDo5wmvoDVnyfZf7MbKMsjTWZFmMN6XY=; b=Nh6PK+JrkpOrgKaaKrjMX/W+MkLNkjFFSPJYLiZlfTHtIFs3M4RRLS7+F/DFJtkUey xQdOsFQvt1j6H+V28WlkqIUgiGwbr+pTrwhWReJI5fOse2QEs3euc+S6Gak/FVo7hVTK AvKrgDOVz2xzc2Vn3fEL0MMhep1ZZICoZh1q7Tozums52Dr8XWh0GhMESAqSuCeOKwXk OWv1CFU5XCZRFzxVvsqnx1PFL00zFt0EN1BFvlgGiXn2YUKanMr8XhKgmzny0rg6VnuY zwxYCVNZKOD0E2AEoG3G7VNuARYDB+7Sn4k8v9tRvaCl1w8KRUIy4Kc/cL8O91ypIOPy 0ZZA==; 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=KSolLaZD; 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-146207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146207-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u6-20020a0ce5c6000000b0069fcd0520f4si19204qvm.573.2024.04.15.21.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=KSolLaZD; 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-146207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146207-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0B7B01C226A3 for ; Tue, 16 Apr 2024 04:13:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7950422F0D; Tue, 16 Apr 2024 04:12:12 +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="KSolLaZD" Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) (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 3A9923BBF6 for ; Tue, 16 Apr 2024 04:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713240731; cv=none; b=NULiUZlXeEdX9M/KzAiXnFSE1nybS9R1XBtBxcskA8mbY7POycLpJYfoMfsDzpoVtyBOei3In3fJtERhBh1FcO5p8I4SXPkhTGQNPC7wbNU67K11+KkiaoE1rM8MMdTdHuycoajKqgmQfNrDs2ebR9gQicvAg0OYQbdCm6L7Dfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713240731; c=relaxed/simple; bh=m0plhmdNbdmA80gesn/7KnCdXtvm5F7fdW9kC5KptxM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WTT5mTULq5qZO3wVZX1JaW/BnzGpfsZpl9YvZJD4QBKO445WvOlJY/1afa0tZLEv9qWu27BV0vl7Xfqkf9W/HXs0x4swMi+jnll7ZSG9harpkQAkL/5M1Tll3Fs+xHqA0TKCchnJwBO94ODBCQrvE52Bk4y7uqfPzwSTbks5jwQ= 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=KSolLaZD; arc=none smtp.client-ip=209.85.161.52 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-oo1-f52.google.com with SMTP id 006d021491bc7-5aa318db8a0so2632791eaf.1 for ; Mon, 15 Apr 2024 21:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713240729; x=1713845529; 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=uVSzHGFLNnrGti654VC11tvpK1bZGKmyJ0hbbIeQ45Q=; b=KSolLaZDORvmHMAd9QWBGgfyAEJoKPd8rzVkjMVt3vWlaJyoEMK5eTCfTK81uuyEEE OXdj1MyObjVj6eA7rXk+YbDXrVRiWXKFkhH9tFZ7o8vM4tYCuQakflIP9L42xHqOIdF0 5cC5YWotZyBGWxSHqETdYDYTMbRt7y/MW84l2t0yz5TuOqXajtMXQ3DN40UqZyQNqBEm r2zd59hRDoEa5PakAihLudgBm1j0eBgK0B+V7nI5pcNx0qrgV0HJI2nwREWqq3p/0HO6 QMM3PAacIcXKCj1T1zv2UaaDIpjZv/Lbq5W8DAeCRE58nfuBZmtignBPKpRfvLBSaZqW +uSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713240729; x=1713845529; 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=uVSzHGFLNnrGti654VC11tvpK1bZGKmyJ0hbbIeQ45Q=; b=bExVwYvjY/p+ovWoDyMZ1LgHE7FEzUz6LaqFAC2ebgZLikShIhOmRXAu66NQGnkR0A Lg73DLIIiYvwv+OI4KiP8aFm2EjvlwiN5vVQ78OjVFlp0I92VXHWg7w8pb3No+6E3OuX gQnRkSP5YSt2k3WloCEUsJWkFld/Yhsl7Xa6bdhc+UkRYeFZEz0WHiWqTabT2l4kdDZa /Z6ruVdP2BN+AisFbFkwp3tRMR7IR8gD5xKlztOaRyapj2ePOdSRsAgUicZkVv1ZYv9P bTjWl/lW3F5AooATcjUALwc7msI0Mwuh6FzKTaurx/KX6CC5I7jLb6CiZM0xwJLQRwTF vhVw== X-Forwarded-Encrypted: i=1; AJvYcCXUn5K2DrMDlryIWPg92iyHXIfpza6yAZV0JJ4GNpZaMhWL018QBmYs2SqFzSQQiKDohOJsq0m2Uq+6yNxFkVwxHfNle84B9OwnU8SQ X-Gm-Message-State: AOJu0YxuSXp2LHMzNHomkI8B1wv/wENfKHpQqdciPKf+CQHCq+OnVmJ4 fPhyMYAoaNR0XHQC8/WiH240yXo+PRgEMuO1MYIqxiEbon09lCCKa/NKFvKPz7o= X-Received: by 2002:a05:6870:315:b0:22e:8539:60a0 with SMTP id m21-20020a056870031500b0022e853960a0mr12983308oaf.46.1713240729449; Mon, 15 Apr 2024 21:12:09 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id z184-20020a6265c1000000b006ed4c430acesm8383149pfb.40.2024.04.15.21.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:12:08 -0700 (PDT) From: Charlie Jenkins Date: Mon, 15 Apr 2024 21:12:02 -0700 Subject: [PATCH v2 05/17] riscv: 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: <20240415-dev-charlie-support_thead_vector_6_9-v2-5-c7d68c603268@rivosinc.com> References: <20240415-dev-charlie-support_thead_vector_6_9-v2-0-c7d68c603268@rivosinc.com> In-Reply-To: <20240415-dev-charlie-support_thead_vector_6_9-v2-0-c7d68c603268@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?q?Cl=C3=A9ment_L=C3=A9ger?= , 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=1713240719; l=1065; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=m0plhmdNbdmA80gesn/7KnCdXtvm5F7fdW9kC5KptxM=; b=7DRonXaAgLJzhWvXE1qbRYS0I+BfU0oGsBOBG0My2i8BWoHww2ZulgK6Ne5SIPj9jjmGT1fAh WB/f+iRxM2uC9jcfHku9va0/Bg5wWaTVh/Ak3KRIWgDEL+7zSph3JfU 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 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