Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1052225rda; Mon, 23 Oct 2023 00:15:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/G5xCGjWGAmHHrGJG8pI5FyDWj6zkUCCMxGlJnGsGMqtpqzP0r58kEgkmSU/KwGqkaLvL X-Received: by 2002:a17:902:e1d2:b0:1c9:ccbd:6867 with SMTP id t18-20020a170902e1d200b001c9ccbd6867mr5101006pla.38.1698045303776; Mon, 23 Oct 2023 00:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698045303; cv=none; d=google.com; s=arc-20160816; b=ad31Cg9qdyibelBW54tlB2Rg7qDvOrU/nqX//aqnGLr8LRBFXhH5R0rKldlfiw8QBL jmZVIzAcb3su8n8pFsEf0XfrFMT7hW6FNjjY3DBwW9hi456/oRNMmscv9XiXsgYDulWq 0zNy5alSYlIs0uv+JWNN9uAPWBoaRueSCaUqOU6qSBPNVJzVP+dz7hfxg4EtQXznoToF 9wAuQS1EXWAR0JywdN2DEU0UnBEfUcLAP8h7PcYQKVTkTy+keUqPb30mQ/E2LL8ktCOa QW3/Wk3x5iEj7OCy11wAz7SxtRyhkCs3gVrpsln4SQD6SAy3hsgM07kwbDpROkqEBw05 j2BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=26tPvjduKfKMC5Y+TnU+2kouKBcEVMva4kAveFGyFik=; fh=Yj9ash3au2HzfeDl1aJuxMb9nzzR1cUSPzijTq9fzSM=; b=EpLNnRwIbnNM3G2coMFuGqvwJYff3JuUyr/cCHZKbB56nzOPpK31vbWCCAnRNPTVZK I9+H2gfDYs5mNEjn7MiKSwornzvyZcsyQKWTg9tyYwWAJ0Uy/5mUpEK1Yh+DewgxajmP csnXsSrjAkPNu8z3EjybTK0w3p15hkq1rof6+aeCstZtDxP8hD6OZX7ureSsomXBdztk P1J04D66CIhZEOKu0djle88gzxidyFxFqGD8Mp0d5kp9+HMmsOVAQpfxWSktp/3p2tYo 7wzAES4WB7K43d42ghD1IP+pAmDxh38ncNuXKg2CvGbwNWom1dpZZd1BYbWR9pubM+ra NJnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=F1G3kJxL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id z18-20020a170902ee1200b001c3f96ec6d6si5879643plb.111.2023.10.23.00.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 00:15:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=F1G3kJxL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 3399B8051AA9; Mon, 23 Oct 2023 00:15:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbjJWHOw (ORCPT + 99 others); Mon, 23 Oct 2023 03:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjJWHOv (ORCPT ); Mon, 23 Oct 2023 03:14:51 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5110EA4 for ; Mon, 23 Oct 2023 00:14:49 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32de9764793so445067f8f.0 for ; Mon, 23 Oct 2023 00:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698045288; x=1698650088; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=26tPvjduKfKMC5Y+TnU+2kouKBcEVMva4kAveFGyFik=; b=F1G3kJxLX7MHUk0i87R8TZJzTWP4Yp8XZmYqCgGxwkp8HrQMyaCX6Dt1j1gxBvkXXB kG4znk0BfygEQPhEOzlqU2kFaBkSxvUGrO1b8PAV8Pv3VWDpqsrSACjC+lAgwFuqeYi3 bMjrnXrTLNwUwFLZNXccASFeh6FiZH+Kw4fM3BrlRjDqIP2iJMIbPMxee17m5FpzTOwq qZh8in5bhZhHmZzu6XsG5ux1xj8v7+SkQoWSH0p798POrU0wFfgmVX7Augx1MP0rFlIu hy8D4GqpSf2AWZjVZ7Uke7w/a26iww4Xqm2FtpYDPeV0ALnGyBEZnoPPl7ESXyspz/u3 FJKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698045288; x=1698650088; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=26tPvjduKfKMC5Y+TnU+2kouKBcEVMva4kAveFGyFik=; b=Cwv7KzJ+zG5x55TIiECXaYARr8WP1repTf7Rs8ihwhYooJfJxeSv3ECBpbYPREfb0H JSgVE4MWLdfKTXGs0shoKdst6cQmgEU7SgQjOx9Gq43BDsbHILpP4CPxmBtnxVMx0dyk aVzRI22qAIRdDtXaLKgK1Q2waAaWdVtlWEr2jT6vqVVeB+SOAKjE//D0Iu3FqDWDUGOi PZZgow9YULdfaXt8BwTzYc39BRkNUusLbZpdR/p2Y7p/BCaM+1whxrsp+7+MstKi6coj 69quGm7bRUgzNBp+zFkHbyXr+ynXuzn+lYbfESkl6pfTBW2sbDfMPlyHOSN5tKWNY9lK fVuQ== X-Gm-Message-State: AOJu0Yy9WsJe3yInxQ7thZzKZcnInIqWEgMo/tm7POXAT+MSNwe+953W wzUMM+1dnxG/gNGyQV8QEHaZ3w== X-Received: by 2002:adf:a356:0:b0:32d:c293:1ab4 with SMTP id d22-20020adfa356000000b0032dc2931ab4mr5018430wrb.6.1698045287746; Mon, 23 Oct 2023 00:14:47 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:17bb:4fd9:531:a7cc? ([2a01:e0a:999:a3a0:17bb:4fd9:531:a7cc]) by smtp.gmail.com with ESMTPSA id r8-20020adff108000000b0032db1d741a6sm7144610wro.99.2023.10.23.00.14.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 00:14:47 -0700 (PDT) Message-ID: Date: Mon, 23 Oct 2023 09:14:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 05/19] riscv: add ISA extension parsing for vector crypto extensions To: 7626f978-e9ea-4f8f-b814-aeac02bd3712@rivosinc.com 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 References: <20231017131456.2053396-1-cleger@rivosinc.com> <20231017131456.2053396-6-cleger@rivosinc.com> <7626f978-e9ea-4f8f-b814-aeac02bd3712@rivosinc.com> Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 00:15:01 -0700 (PDT) On 20/10/2023 04:43, Jerry Shih wrote: > On Oct 19, 2023, at 17:35, Clément Léger wrote: >> On 18/10/2023 19:26, Evan Green wrote: >>> On Wed, Oct 18, 2023 at 5:53 AM Clément Léger wrote: >>>> >>>> On 18/10/2023 03:45, Jerry Shih wrote: >>>>> >>>>> 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). >> >> For Zvbb and Zvknhb, I used the following code: >> >> static const unsigned int riscv_zvbb_bundled_exts[] = { >> RISCV_ISA_EXT_ZVKB, >> RISCV_ISA_EXT_ZVBB >> }; >> >> static const unsigned int riscv_zvknhb_bundled_exts[] = { >> RISCV_ISA_EXT_ZVKNHA, >> RISCV_ISA_EXT_ZVKNHB >> }; >> >> 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. Yes, but for instance, what happens if the user query the zvknha (if it only needs SHA256) but zvknhb is present. If we don't declare zvknha, then it will fail but the support would actually be present due to zvknhb being there. Clément > Please check: > https://github.com/riscv/riscv-crypto/issues/364#issuecomment-1726782096 > > -Jerry >