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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 422FBC433FE for ; Thu, 24 Nov 2022 10:47:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8E826B0071; Thu, 24 Nov 2022 05:47:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C3F0F6B0072; Thu, 24 Nov 2022 05:47:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B08236B0074; Thu, 24 Nov 2022 05:47:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A11736B0071 for ; Thu, 24 Nov 2022 05:47:37 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 51E9EAB040 for ; Thu, 24 Nov 2022 10:47:37 +0000 (UTC) X-FDA: 80168009754.03.762B7BA Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by imf05.hostedemail.com (Postfix) with ESMTP id CADA0100006 for ; Thu, 24 Nov 2022 10:47:36 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id i12so1948918wrb.0 for ; Thu, 24 Nov 2022 02:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FdtUZWyW9M5SwW4fKcdbfWbLqv835trkT/YigXlBk1w=; b=lZRuJhU0PWoWBofvLovP0IppWpFGWN7fWZxhDO9ezc4w5caGcqd7GVbP7bCb7rAx1m WQ6CU4A1vpmhvvRv/MQ41imUpzdHYbhwg3dDp0rbi28alBmmwHbyXBwRq3aChs75OSDn cRrBdPyiuU7dJYFQtVWFi1LEgVC4mSS2oQjdxundznfY1LJUvxRqILH4ZmHrlPOswPBO jEcYKziqFvY3FrZ63yxBO4J0U840aXaQmAc4K6YO6KlrTgIyIecW0EnswrSdUB+3/Jmh cj61cpVBa/01MKcxUSm/M8X+zKHd0MycDwttn5w4VYm2g67Pq84aKg+vXL7bGEl/EnSK OJTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FdtUZWyW9M5SwW4fKcdbfWbLqv835trkT/YigXlBk1w=; b=335X0kY/qIEgun3IfrrhDWOcd0PNuI8kQzTeDjeVPG2c56/BbSxmTSI1ERsFc2qML6 hobywiii87LA7BqVsLS1uJXu5j2wr86kH30tQxQ8h14eGzrdhGlQimVsuUfZfeWpOHQi CdbGkMPyKv5Hrt3/9yj5hXMm1wdRVqOl0ojrf9yCUCWdlnSZQpTGkgZ+1x8tXUaoou0D 5qmEPa9Qc3h8ww7Q/zS1UoyvfQHWGbo434a2hbDUrOMvLlPKOCVdXje3nEvJJMRWpCnN 1SKWSGg7v3zGrCTQClijkfN+8FwPc2QpimAuY/L34ob9Wnxx7mIuGjfIY60mAg98vgj9 RB4Q== X-Gm-Message-State: ANoB5pmiz9mFNzYVCAED+Er4GXvxDNsw+D841gHKiXsroEnWSzjvrb7z o4MXY0wNihzUuahbtA/zXRcSIQ== X-Google-Smtp-Source: AA0mqf7Y1aVWMReyOdtNOIWeuH3AL6Av2lChTeX2TQ4ZCkY3jMlcei8W4RANI/Yp76L7gWGL7TGKGQ== X-Received: by 2002:adf:ebc6:0:b0:241:c6d8:be83 with SMTP id v6-20020adfebc6000000b00241c6d8be83mr12040852wrn.454.1669286855389; Thu, 24 Nov 2022 02:47:35 -0800 (PST) Received: from vermeer ([145.224.92.100]) by smtp.gmail.com with ESMTPSA id l35-20020a05600c1d2300b003cf878c4468sm5765534wms.5.2022.11.24.02.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:47:34 -0800 (PST) Date: Thu, 24 Nov 2022 11:47:30 +0100 From: Samuel Ortiz To: Conor Dooley Cc: "Hongren (Zenithal) Zheng" , Palmer Dabbelt , Paul Walmsley , Albert Ou , Atish Patra , Anup Patel , Eric Biederman , Kees Cook , linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Michael Kerrisk , linux-man@vger.kernel.org, Jiatai He , Heiko Stuebner Subject: Re: [PATCH v3 2/3] RISC-V: uapi: add HWCAP for Bitmanip/Scalar Crypto Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669286857; a=rsa-sha256; cv=none; b=DbMKIltrJH8Mnnpe+ew0Bcizi4BhqRepA2hvsGDZQFJiD+nOQ2LZZo0bjOqQe3c1WfLYi4 Bxm1DM4/il4lEcPi4DR+7dUEE+Ug9IkkMqI9ueY3l/xxvo0PSSkI4iPWZb3VdrRJCCSqhE VHponadLmsONnzlBQ+gBTnhAQlI6OuI= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=lZRuJhU0; dmarc=none; spf=pass (imf05.hostedemail.com: domain of sameo@rivosinc.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=sameo@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669286857; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FdtUZWyW9M5SwW4fKcdbfWbLqv835trkT/YigXlBk1w=; b=YKNNY6vyxY0qJa/cdB4NWhYjGnTYMT4AEebNeY7ZxNcV9wn2CraokXW1p8tb6mSeX0nG8g yu7NzrHfp3pe4Cg7ZqZppoqyAOB08xpsTPzgZxAVgLy2Myi4LhssTgUGqPWp4hy8R4gaHb qtUZPd09pOYkOCzPKH7QnufY+lfqwrc= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: CADA0100006 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=lZRuJhU0; dmarc=none; spf=pass (imf05.hostedemail.com: domain of sameo@rivosinc.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=sameo@rivosinc.com X-Stat-Signature: 3p3mhbhtyhq86yq3ho1egqymtbcikw34 X-HE-Tag: 1669286856-316185 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 24, 2022 at 09:58:53AM +0000, Conor Dooley wrote: > On Thu, Nov 24, 2022 at 10:30:21AM +0100, Samuel Ortiz wrote: > > On Mon, Jun 13, 2022 at 02:46:35AM +0800, Hongren (Zenithal) Zheng wrote: > > > diff --git a/arch/riscv/include/uapi/asm/hwcap.h b/arch/riscv/include/uapi/asm/hwcap.h > > > index 46dc3f5ee99f..bfed3e5c338c 100644 > > > --- a/arch/riscv/include/uapi/asm/hwcap.h > > > +++ b/arch/riscv/include/uapi/asm/hwcap.h > > > @@ -22,4 +22,26 @@ > > > #define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A')) > > > #define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A')) > > > > > > +/* > > > + * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2 > > > + * > > > + * As only 32 bits of elf_hwcap (in kernel) could be used > > > + * and RISC-V has reserved 26 bits of it, other caps like > > > + * bitmanip and crypto can not be placed in AT_HWCAP > > > + */ > > > > Have we agreed that multi-letter ISA extensions would use hwcap to be > > exposed to userspace? With so many potential extensions, we could > > quickly run out of space on AT_HWCAP2 as well. > > Palmer whipped up a PoC hwprobe interface (during Plumbers I think) that > Heiko is currently looking into - I think his motivation is misaligned > access performance. There's a branch but I have no idea if it even > compiles... I'm mostly waiting for whatever Heiko comes up with ;) > > https://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux.git/log/?h=riscv-hwprobe-v1 > > This patchset seems to need a rebase anyway per your other reply, but I > guess that the new proposed interface would be preferable? I think so, yes. Patch #1 is definitely needed regardless of which interface we pick for exposing the ISA strings to userspace. Cheers, Samuel.