Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp749864rdb; Thu, 19 Oct 2023 19:43:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfhpAHZR0Wh/S+4IldShsfOvKwznjqOIUJUAmEnOcj5WlN7L4uViLFFwyBZyHAjzAZalwV X-Received: by 2002:aa7:8439:0:b0:6b3:55fd:d851 with SMTP id q25-20020aa78439000000b006b355fdd851mr414377pfn.10.1697769834737; Thu, 19 Oct 2023 19:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697769834; cv=none; d=google.com; s=arc-20160816; b=e7rMS5sBKsgHkSdKg7IE8tb8lkJcP08+2R5n8mwHBhwpy8ttqcelGacFP5vm4EzzOG erjC6sP5dE3FfKdk3+4bsWCIaOUpeyMAWfDfddbgHAdU8RVjaRbUFdgLNoxFjqc4+wJN UKHhG9uiJWmdQeFGPPpfME0it8+a7EU+dW9A16POmkA8XRWMNxn7/mthjNUUOgeVW4Ir CIx5iKrhCWoYI5WCORciK9P067BXM9qi9t7EXIa4YKWLXwKNZButbYBAD5lxiP645pvI YX+vS7ugzO0ZfMVcaWCBEyoghU/NEYDIq+F5TJ8mz3MsBc/5rC7AJzJLhOC4uoiQxDsc /Fdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:reply-to:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=cDoTNufgUg8VIMedry3dGiEENRRb4/cr/7WsD8Tt8Go=; fh=eMQwmSBjMogKdU3v1ds3Whb6siQLe3sJNbXwvFlGhdM=; b=ZrTl3jKkmJ4imAChUxXcI9Clu4HcMkveSfEOWi7yFU7RUcc01D6I1JhKy4XEk1VNyM F4R2WrdFHvYeIWy3W8XhdkDhpVCIlrFR0au1TJlUuIVlpAbo4Lh1vsby8f9EXjZrn7VT sMojDtronZdYye5kiW7qE3UoLXZ29lIWNrodv1ISOR6ZVgfdY/ndPYQ6r7fA+C/lJaPI 42lPDFcAXKlVciun1vHpI2GSRKjUy4vaoRidP1laf3A3xmxyjgDxtAvUqtic+WWKytJk wvIK2r60GAVlQt2p0MjsI2FFupj/y21BWLbI+q+aqtTZ+aUnW70gLYcA6UnTnYpfUuSp rAXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=iVHEBMUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c14-20020a056a00248e00b0069023e4bcb4si1011596pfv.114.2023.10.19.19.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 19:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=iVHEBMUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 037E181F331F; Thu, 19 Oct 2023 19:43:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233398AbjJTCnh (ORCPT + 99 others); Thu, 19 Oct 2023 22:43:37 -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-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) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 19:43:52 -0700 (PDT) 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