Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3955760rdg; Wed, 18 Oct 2023 10:27:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGV8KLjXLj2VtZGXGZhhSDmO6Pl2FKW9As7hP+c0WqZ2CIq2QBwOMRCsUNUMUa7e01zSHMS X-Received: by 2002:a17:902:9887:b0:1ca:8541:e1e7 with SMTP id s7-20020a170902988700b001ca8541e1e7mr17170plp.22.1697650065188; Wed, 18 Oct 2023 10:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697650065; cv=none; d=google.com; s=arc-20160816; b=eXQKhkrJPV0MA9vB7waI8Bg5mbIsZ45sJ5vqt27xCbSIK8/IqXXUy9Cg/0LQf4FaN5 obIFVQacVA0YPpl3IIpa8wWJoPwg6o/mfzwhnxt0WIFL+rCEaGEjvHceGsbDrHaWqIhL +e5uAjbG79ijthmO7GUBV8azVucLcMjQbGi/4HpzoV27Y9pPWMugCOBt6G+vKkBfAg0K q5sefu5tBupBFaUk5mzf7iVkJ186v5VtwbA95mZ8TWs/uwc6g2vH88iVoidzhV2zrqP3 4CBPqAw9o2Yd1kiIUwBQq6OnOSYLdkLRWQb5I0Bx2C3VvRXvbp0ePJVF75+NGrmvUnvX 3c8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=k+Kj7LOopyrO9EbtedWl87IOzpgEdsrSg3mf/n9/RII=; fh=OpjytHWy85/n3Q0GgEPecbWtK9Ju7LCqxwJo0rFYZ1I=; b=rSYl7REkViiopzIkUuHT42k+FjbG9HSv94MPtfu6nFAkb6BhgVnQusT7iCf3ns7W6V buvSpVUVjNOT1P0HAS9bGD+xWfINyF0skVjyzGCH/PNhel6jaEvuhkW9Y3NN9HY+JshL xL+wycG/NEM6nRmpfU4RQIF26Ngq0Ehbp4WDDnr9pSfpC593efruhwgg/TPOKmnareEP F9XNnIpyJJN8HsQRVmfQ6UPsxCj/KLNi1T7fg+6AqGI9Gdmx5BNdBRyGe6aPpun4HGmP I3XHtQX9W2yc54o9Jak4+OJ+jJxpoeczamHu+azHmC+DcBt1rcwFKuCzF4i+BlqeGHjK tBXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=23BVLdIz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 10-20020a170902c14a00b001c73732c1f2si295923plj.223.2023.10.18.10.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:27:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=23BVLdIz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C545D8087255; Wed, 18 Oct 2023 10:27:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjJRR1Q (ORCPT + 99 others); Wed, 18 Oct 2023 13:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJRR1O (ORCPT ); Wed, 18 Oct 2023 13:27:14 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05102448D for ; Wed, 18 Oct 2023 10:27:12 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2c5210a1515so56689961fa.0 for ; Wed, 18 Oct 2023 10:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697650030; x=1698254830; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=k+Kj7LOopyrO9EbtedWl87IOzpgEdsrSg3mf/n9/RII=; b=23BVLdIzqR6bI4D1ozZsMCKXQpAIK45Sbf9jMpNSCiYy8nWHZEg0GgAQzttgeoJSP0 91i4sZ6jeqyswQcpTyVHiU6//M3B1zE9WqupBHmA5oDLYizxIGV0ViAS5+GfTXZhg5h6 QAUlKxTXrxlqjC1tvlf9zPsYLbCDF3dLGUx6NnCZoOTzV016qVkWP0qZ4UzgVhBdu9cD 7BjoKZEpFhhJUtyu2e+jDTjRmP20VyP+TkXMk+QP3gpHYLRSTJPhXGljrVmRgtg8hjpL I1AEZBxLyqZ7xZiFtPU1giFieM1+pXPBuCt0slkEs7397q4KT+preYsnLf5Vha7epSKK HOzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697650030; x=1698254830; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k+Kj7LOopyrO9EbtedWl87IOzpgEdsrSg3mf/n9/RII=; b=rehpXmA4W78Rh52HTO/akcS5wKYJlZqhl7zAiA5dXxV/ETbS4J5k+I3zPaNBXid+nF 8CrUZb8WTmLQuKQ6xuH1O98cNHZ4JWHB0g0SYRil59mLPTlV3fZWydgFwEZeIT00abEc +9CGJRoffnb+3MWurtUjbpEK3eC8QKUnNnAe/sK5Pg/eLS1CP5QQYT22Vm3AltvpYNd+ k6Fesz9kzCCRGhcqIjhltyX+0KHfmXU2G6PSCsW2MmX1Cx4IW1NxeUH0hq9YS3L9ziyB q2pkVZhjGcdn4CP1diDeVwtGpy0hkbrHVBEdcBv0A9fhEeVc785LsjyEG3EWOYcAG13N XrRA== X-Gm-Message-State: AOJu0YwPcaAsRz2yXpkZAxEyG0BU2TbkniBE7I7S6QcOaaMvgXfsDook moSlVRNXUxLeIui2IUP9EebMv2WyNqPm7TiGNiKVvw== X-Received: by 2002:ac2:4a82:0:b0:506:9c0a:17d9 with SMTP id l2-20020ac24a82000000b005069c0a17d9mr4831537lfp.40.1697650030177; Wed, 18 Oct 2023 10:27:10 -0700 (PDT) MIME-Version: 1.0 References: <20231017131456.2053396-1-cleger@rivosinc.com> <20231017131456.2053396-6-cleger@rivosinc.com> In-Reply-To: From: Evan Green Date: Wed, 18 Oct 2023 10:26:34 -0700 Message-ID: Subject: Re: [PATCH v2 05/19] riscv: add ISA extension parsing for vector crypto extensions To: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= Cc: Jerry Shih , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:27:42 -0700 (PDT) On Wed, Oct 18, 2023 at 5:53=E2=80=AFAM Cl=C3=A9ment L=C3=A9ger wrote: > > > > On 18/10/2023 03:45, Jerry Shih wrote: > > On Oct 17, 2023, at 21:14, Cl=C3=A9ment L=C3=A9ger wrote: > >> @@ -221,6 +261,22 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = =3D { > >> __RISCV_ISA_EXT_DATA(zkt, RISCV_ISA_EXT_ZKT), > >> __RISCV_ISA_EXT_DATA(zksed, RISCV_ISA_EXT_ZKSED), > >> __RISCV_ISA_EXT_DATA(zksh, RISCV_ISA_EXT_ZKSH), > >> + __RISCV_ISA_EXT_DATA(zvbb, RISCV_ISA_EXT_ZVBB), > >> + __RISCV_ISA_EXT_DATA(zvbc, RISCV_ISA_EXT_ZVBC), > >> + __RISCV_ISA_EXT_DATA(zvkb, RISCV_ISA_EXT_ZVKB), > > > > The `Zvkb` is the subset of `Zvbb`[1]. So, the `Zvkb` should be bundled= with `Zvbb`. > > Hi Jerry, > > Thanks for catching this, I think some other extensions will fall in > this category as well then (Zvknha/Zvknhb). I will verify that. 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). IMO, decomposing "pure" bundles makes sense since otherwise usermode would have to query multiple distinct bitmaps that meant the same thing (eg check the Zk bit, or maybe check the Zkn/Zkr/Zkt bits, or maybe check the Zbkb/Zbkc... bits, and they're all equivalent). But when an extension is a superset that also contains loose change, there really aren't two equivalent bitmasks, each bit adds something new. There's an argument to be made for still turning on the containing extensions to cover for silly ISA strings (eg ISA strings that advertise the superset but fail to advertise the containing extensions). We can decide if we want to work that hard to cover hypothetical broken ISA strings now, or wait until they show up. Personally I would wait until something broken shows up. But others may feel differently. -Evan