From nobody Mon Feb 9 05:55:29 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.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 E79971D63D1 for ; Tue, 23 Dec 2025 02:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766457888; cv=none; b=DLwCuxt+V9jypejB8fl8jiNMigeM7AgdGLIjn4IZQ2Gn1NKFtLlt6bg0Gtm8kQsOP3L1oClH+ZTIihGZ/fG6PIvT6cD/jjd9k0eAude8ewrnj70Sepm5zNus6V9W5uxRmvl1gcWWhELh569icBSLpKiqjeundzuYKEs7948Y3+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766457888; c=relaxed/simple; bh=sjH86l8fjBqg/P28XVaepZ4QSPdPiPG+zQ4vJQuXsKM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=imgNVvAcnF5P3myRYFGXVLvnzhQv4endK72hltalpwzVGvTbaNQ821eRdR7vX0zZR+yEloWc7W0CV7plCIDAs1d/cPFJkODRd7a+DuHid2nwJRqP4Kho2Khs9xu9FNWIdjQHWgz9oRbwrN4AXVXSGkc1D7yngG4KFGL8HPFXRlc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=zX2LFvmM; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="zX2LFvmM" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-7fc0c1d45a4so4153951b3a.0 for ; Mon, 22 Dec 2025 18:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1766457886; x=1767062686; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=nUF/hoFyojyL16/BAIvBMBzPHtMZaCpOp9VnM7T1kwY=; b=zX2LFvmM4RydAaZWQ+qtNZ/82KmAlF8mTu4PE3UgQl9le2n0l+Nl9muHzLjRbW3o5U xWAWFOX6OU/cIkeWbpZ8MRmnXrYGVXGr8/2TJ9eJhzJWao00/QbKNr8yG9PRAb+IR6kY fNywMXN4SPIHDCk+1jgfIPfEdyOJH/gJr2NPjstEA7hhb1faGkstMIvG1OfHTxO3D/VJ frbf9VRYt6Keir8xR/vJDLtC8cu4dBkJWC0NE7GkkvZt+7FkIhccoLrpY8PBiPzE1Mc2 rww18gm3Gva43PbZkVc9wFSdOo5kLxmppzi6/kgLlPYRRp+Tnen5ZGGEnrwkne2EBmWP Dtpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766457886; x=1767062686; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nUF/hoFyojyL16/BAIvBMBzPHtMZaCpOp9VnM7T1kwY=; b=b1xqRgomMrSC0jlAWL1Ai+Liw8j9+0Tu+wM0oh2UemmPf1v8aZN+pM3vMBpDOiV081 ++PRQl61PKmFDOv8UQNJCrvCcqhDkfPEK5r0K+36JR1YM9bqNU8ScAlVYq6mCzJriDhk WfpAQGbOnm5VoR86LfBuXXfzcyD1gJA2DR7EbPZ3Ppo3EkDQ9CFEpksuciluGzYPiT17 /a555VkpeP35c4+NF7yCuoWeZPzI218q3BmCulQo22cabWEK0Kp14HWLufQMdrHJptyI pveRUyUcQF0iCCeNTqmKo++Q2lZKgf0ObK6DRgP0S3KStAlwNdLPSu3dbvoIql9NLtcL V5nQ== X-Forwarded-Encrypted: i=1; AJvYcCWOqR2xc4K1/lMxxyJecW9CIJNugbFGDwSuEep41XM85YPeiGfvN/Ok30DWzC85QtDWVZJOUZT7zXD1dmY=@vger.kernel.org X-Gm-Message-State: AOJu0YzFn03six725A6DA7GXJs5yWOYbQjgkQMUNs6jhKD4KKXxi4WEe mgOjLAcFprCfZHImcYbWJYgPbA5L1MVetgWFZETAfKLKDOS8OPRhBsDYSHpTfqKQKIQ= X-Gm-Gg: AY/fxX5AISGw/UtnwikPDyHvz1GE0yEJX6VUpSae1Hz571Z0SiP81xCkED/pr7LSx1N RdJzeKtglbuRcO4yYhwE6XmRtr7Ns81q9ECO60Zm7QXOdKAmMeodaC/QQGc+dITaUZeOtCkuRAt LhEW/UtTeQI8NTV4lohKQEwwC6VWfjSWpQ7Ija3F1kNvB4bU7cLfGsfueOtiTycTZSeMVvC+xVc 1KXqp88b3aFjv2KUbLuvztWQZ8utWrJW6T+q9NZYtRaXr+dU8uEL/fpjTDM3nTGjtc0lzCQ2wdd gl2KnMcBcrEj1rOINBj4V55NhtyBTO4nfMCJwuhIdZn/k2iI/0qEnJyS82mpRzVfTtI+8oYyzTS 0jEDh0WMvY+Mrm2GFzOI+GaLVZD/ahjoTiHMMn67zljSbQXGHt6AjZO4CEfBEkYs+jjbPCM0UGJ NkE0keOBfNam8vaN3YfFM+0ySbmI78kW8= X-Google-Smtp-Source: AGHT+IFPJvIYUmiOO2w7I3dtZwVUs0BwDcfnBNjmLePOXNfxB9CP88VzU8dMVUem1SKKIF7IePNpYw== X-Received: by 2002:a05:6a00:4219:b0:7f1:4c9c:782a with SMTP id d2e1a72fcca58-7ff648ee056mr11439556b3a.26.1766457886201; Mon, 22 Dec 2025 18:44:46 -0800 (PST) Received: from [127.0.1.1] ([2a12:a305:4::402f]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e88cc1csm11789387b3a.65.2025.12.22.18.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Dec 2025 18:44:45 -0800 (PST) From: Guodong Xu Date: Tue, 23 Dec 2025 10:44:27 +0800 Subject: [PATCH] riscv: cpufeature: Fix Zk bundled extension missing Zknh 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: quoted-printable Message-Id: <20251223-zk-missing-zknh-v1-1-b627c990ee1a@riscstar.com> X-B4-Tracking: v=1; b=H4sIAAoCSmkC/x2MSQqAMAwAv1JyNqBxA78iHsSmNYhVGhBR+neLt 5nDzAvKUVhhMC9EvkTlCFmqwsCyzsEzis0OVFJbEdX4bLiLqgSfMaxIHTnHtu8bS5CrM7KT+z+ OU0ofaJcxvWEAAAA= X-Change-ID: 20251223-zk-missing-zknh-262ffed774d2 To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , 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, Guodong Xu X-Mailer: b4 0.14.2 The Zk extension is a bundle consisting of Zkn, Zkr, and Zkt. The Zkn extension itself is a bundle consisting of Zbkb, Zbkc, Zbkx, Zknd, Zkne, and Zknh. The current implementation of riscv_zk_bundled_exts manually listed the dependencies but missed RISCV_ISA_EXT_ZKNH. Fix this by introducing a RISCV_ISA_EXT_ZKN macro that lists the Zkn components and using it in both riscv_zk_bundled_exts and riscv_zkn_bundled_exts. This adds the missing Zknh extension to Zk and reduces code duplication. Fixes: 0d8295ed975b ("riscv: add ISA extension parsing for scalar crypto") Link: https://patch.msgid.link/20231114141256.126749-4-cleger@rivosinc.com/ Signed-off-by: Guodong Xu Reviewed-by: Cl=C3=A9ment L=C3=A9ger --- arch/riscv/kernel/cpufeature.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index b057362f8fb5f92d9a608b223666831d769a805c..f5855af0453d5ce206f8c8201ad= 108dfe4d300fb 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -279,23 +279,22 @@ static const unsigned int riscv_a_exts[] =3D { RISCV_ISA_EXT_ZALRSC, }; =20 +#define RISCV_ISA_EXT_ZKN \ + RISCV_ISA_EXT_ZBKB, \ + RISCV_ISA_EXT_ZBKC, \ + RISCV_ISA_EXT_ZBKX, \ + RISCV_ISA_EXT_ZKND, \ + RISCV_ISA_EXT_ZKNE, \ + RISCV_ISA_EXT_ZKNH + static const unsigned int riscv_zk_bundled_exts[] =3D { - RISCV_ISA_EXT_ZBKB, - RISCV_ISA_EXT_ZBKC, - RISCV_ISA_EXT_ZBKX, - RISCV_ISA_EXT_ZKND, - RISCV_ISA_EXT_ZKNE, + RISCV_ISA_EXT_ZKN, RISCV_ISA_EXT_ZKR, - RISCV_ISA_EXT_ZKT, + RISCV_ISA_EXT_ZKT }; =20 static const unsigned int riscv_zkn_bundled_exts[] =3D { - RISCV_ISA_EXT_ZBKB, - RISCV_ISA_EXT_ZBKC, - RISCV_ISA_EXT_ZBKX, - RISCV_ISA_EXT_ZKND, - RISCV_ISA_EXT_ZKNE, - RISCV_ISA_EXT_ZKNH, + RISCV_ISA_EXT_ZKN }; =20 static const unsigned int riscv_zks_bundled_exts[] =3D { --- base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578 change-id: 20251223-zk-missing-zknh-262ffed774d2 Best regards, --=20 Guodong Xu