From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40628C001DF for ; Fri, 20 Oct 2023 02:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346857AbjJTCni (ORCPT ); Thu, 19 Oct 2023 22:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbjJTCnf (ORCPT ); Thu, 19 Oct 2023 22:43:35 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00CE6130 for ; Thu, 19 Oct 2023 19:43:32 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c9fa869a63so2630965ad.0 for ; Thu, 19 Oct 2023 19:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1697769812; x=1698374612; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:reply-to:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cDoTNufgUg8VIMedry3dGiEENRRb4/cr/7WsD8Tt8Go=; b=iVHEBMUeSeqJ/1x2HN+OqCzMQkEBddYTaASjW5NIDZPXEkvuJ5UIgwDfnfHWUVIWRO fwxTO5LFBuTmBnebYIMY7iFUjoNid9aBw30gWzO03gmaURU7nbF2cvQqzCvPDA2v8LVp uO949UqK0uPN5Gipv7PO/sHTRXzb9GSJ68axsTgUWIEsrSdCrv0znmfh/Hghh5TqG9wa ZufmNgaMqHNqYV1Oh6GA/DDS9p5ad/RrdkU1kjRi1enQ2KGcZuSQ4sS4gQhSdzjNHSjt C2MgrVFwXiUC8Blv7FvLs6Jzfds+gifeLSZoAn8pkXYj+RvoffgD6NkKbYBrjZAvV5nh etMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697769812; x=1698374612; h=to:references:message-id:content-transfer-encoding:reply-to:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cDoTNufgUg8VIMedry3dGiEENRRb4/cr/7WsD8Tt8Go=; b=l8OGGsO5gVF8XCBHoO9IL/RIevtm3B+yPXaolmcYwWZLPW+MPOmjEkz+E4YkEhQ0Mx njLwqnhvMzgvo57JNe2r9xb34ZBwqUlaS4sMXvtSBtXCfJEwIfcsT9O5uKBEiuNIXP4n CMjGfy2EcmA3kyX8Cem7i7UkkE6N6usfzBziUq0i3Hrag+jnGv4wyhTX/mkw5Kj1xQIf FG+DwndFj4CCPXJ96fx7Qp8+KcTjqnISdLGxhiaYH/lQBmtwydXH0xCRPbG/ilvX0I7B lShFYB0KC9iL1vITA3Fnu2dydpoxNE1WSpLKiejwv6VPlzljGl/gKdNySnxH3cXpddBB 19oQ== X-Gm-Message-State: AOJu0Yx6NQ6bJVLAxcmOX2J1o6qnWrsiJG7Xhfl+SFwj3I/b1TES6+ZQ 9NGtkrk48j7XV9+qkViVxO3Ytg== X-Google-Smtp-Source: AGHT+IGXBA72PnmS62ZR4OQ5kEhD/+NqQEwfcdeZ7uNa3mZO/crAV6WwCtdwJk3FS8Io2v66p3iXrA== X-Received: by 2002:a17:902:ed83:b0:1c5:9c73:c91c with SMTP id e3-20020a170902ed8300b001c59c73c91cmr718957plj.48.1697769812206; Thu, 19 Oct 2023 19:43:32 -0700 (PDT) Received: from ?IPv6:2402:7500:5ce:a18a:15ff:8e1:37b4:22a1? ([2402:7500:5ce:a18a:15ff:8e1:37b4:22a1]) by smtp.gmail.com with ESMTPSA id jk10-20020a170903330a00b001c3a8b135ebsm392221plb.282.2023.10.19.19.43.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2023 19:43:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Subject: Re: [PATCH v2 05/19] riscv: add ISA extension parsing for vector crypto extensions From: Jerry Shih In-Reply-To: <7626f978-e9ea-4f8f-b814-aeac02bd3712@rivosinc.com> Date: Fri, 20 Oct 2023 10:43:26 +0800 Cc: Evan Green , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Conor Dooley , Samuel Ortiz Reply-To: 7626f978-e9ea-4f8f-b814-aeac02bd3712@rivosinc.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <20231017131456.2053396-1-cleger@rivosinc.com> <20231017131456.2053396-6-cleger@rivosinc.com> <7626f978-e9ea-4f8f-b814-aeac02bd3712@rivosinc.com> To: =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= X-Mailer: Apple Mail (2.3445.9.7) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Oct 19, 2023, at 17:35, Cl=C3=A9ment L=C3=A9ger = wrote: > On 18/10/2023 19:26, Evan Green wrote: >> On Wed, Oct 18, 2023 at 5:53=E2=80=AFAM Cl=C3=A9ment L=C3=A9ger = wrote: >>>=20 >>> On 18/10/2023 03:45, Jerry Shih wrote: >>>>=20 >>>> The `Zvkb` is the subset of `Zvbb`[1]. So, the `Zvkb` should be = bundled with `Zvbb`. >>>=20 >>> Hi Jerry, >>>=20 >>> Thanks for catching this, I think some other extensions will fall in >>> this category as well then (Zvknha/Zvknhb). I will verify that. >>=20 >> The bundling mechanism works well when an extension is a pure lasso >> around other extensions. We'd have to tweak that code if we wanted to >> support cases like this, where the extension is a superset of others, >> but also contains loose change not present anywhere else (and >> therefore also needs to stand as a separate bit). >=20 > For Zvbb and Zvknhb, I used the following code: >=20 > static const unsigned int riscv_zvbb_bundled_exts[] =3D { > RISCV_ISA_EXT_ZVKB, > RISCV_ISA_EXT_ZVBB > }; >=20 > static const unsigned int riscv_zvknhb_bundled_exts[] =3D { > RISCV_ISA_EXT_ZVKNHA, > RISCV_ISA_EXT_ZVKNHB > }; >=20 > Which correctly results in both extension (superset + base set) being > enabled when only one is set. Is there something that I'm missing ? We should not bundle zvknha and zvknhb together. They are exclusive. Please check: https://github.com/riscv/riscv-crypto/issues/364#issuecomment-1726782096 -Jerry