From patchwork Tue Nov 14 14:12:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 13455358 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82DE3C4332F for ; Tue, 14 Nov 2023 14:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gSYarMD82CQgRC+4DWuujXBMIVQySFwWyftwXQKPy3A=; b=zgzn3YJlMQ+d6z apq/Chd/5Vwc46rvlzEEIRnWWHVLWVLSrYK8RNfw/ZFo6hOMrsnbUKMoj6rRzRuF3ehJ5dGFpKXbx 6IJ2f9FQqGSjX9Y7jFI6D+Y4eLOe0gG5fqii6lZai+kX/jm3Fc9tGvvge18rLswyaAIks2c4hxZUv yX0oUMcb/YWN6wiXHMMzB74sneMRtWQSJT1zOlot9adhNeVMqU1aYn3On8/Diuskd1+CSxNja66TA 0ff83Nb548J/UX7Jbv1O9xcBwm67B9BynIHHMM8oFkPugvo4doaX9wedlY0VN8aGbWzaMmVEBg8ut YHrwe/Jl2hfzfGz+S03A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2uBC-00G9Vp-0J; Tue, 14 Nov 2023 14:14:14 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2uAw-00G9Al-2h for linux-riscv@lists.infradead.org; Tue, 14 Nov 2023 14:14:00 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-77773d3246aso14497585a.1 for ; Tue, 14 Nov 2023 06:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1699971237; x=1700576037; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; b=wKXNhWZ4X6OIDwJ7o5oz8E06uLwwEKx5X0NsnX4b+MbSzltFT1UlRz9rdkFvoqlofo DlwoTTfowhWyAxt4sGPUyKz0aEwdC/dqdEKCD6r3+qJ1OPNloVpOFMFvp6fuzMmUvq1P IoGe1Iq/ClEHplbT/Is3WOAcSZiYvHyNqQ8SQt6UeEmHGHXZ27AIN1TvDLLNiU8IAUGC Ttu3JWF+aDwLLJzBRuPXGy9Zgr7UBOZpwv8RWmETi2beDNAOBo3KsTWyGNJjdOVGSi3E j7gmRzLNwKeXTmcF3SToCM5uxgA5MIVI+YagmNn3kw0adVYOtQWyvueQGDQu7+p2vPdA 6Xtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699971237; x=1700576037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8oJqbvRhcnLQ4NxthWPQmg85qomzW1aIjvQdZvqQ+P8=; b=EXulhsxwUiX3HDGFRW6nd9pg6T+h/cCxFPS1qnWM/e+e7cMPO+VV4nBEMEfIvDJtBU cla+j/YPo39X1m6OkCLGUOl4eou5qTYC6d5X5oh/E4mreLHJ4HDxU7ectTDIBI5FbEeu 4WGrb8/CY9se/sdQOIsGW9+MkdePuxpG799YkWaosyvX6hJQzd7VjPnha1WunDBnxqCe JGcQY0/ZTi6p4ordsEH8Haw6t0Fhdy1noCzLNJPouwZiMdxSjaB+kazHcAMO8EbYCz8/ sNQAkxpduWgTzP40y6D1aIdDUXHY9i9GVE0kGNAANrRGuIhfe59Rq3IiI65t0drzu4HY SU7w== X-Gm-Message-State: AOJu0Yy8BAl6amqMpAq2kGOvYDlJG5yStlHhPff+D1HGkcUPGt2381+5 n2H/aLIU9AVJYk5r2kr6POmrxxl8qLcMJxujcVw38Q== X-Google-Smtp-Source: AGHT+IF9EjIfzzCxNwPyM1ga1yNOhI5yYokOjuEfqsXGtogg+vNsqW/HCxpZN6Ez5oZMRSmIbkGJGw== X-Received: by 2002:a05:620a:28d4:b0:773:a789:cd15 with SMTP id l20-20020a05620a28d400b00773a789cd15mr2090356qkp.6.1699971236775; Tue, 14 Nov 2023 06:13:56 -0800 (PST) Received: from carbon-x1.. ([12.186.190.2]) by smtp.gmail.com with ESMTPSA id m2-20020a05620a220200b00777611164c5sm2701263qkh.106.2023.11.14.06.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 06:13:56 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Palmer Dabbelt , Paul Walmsley , Rob Herring , Krzysztof Kozlowski , Albert Ou , Jonathan Corbet , Andrew Jones , Evan Green , Conor Dooley , Samuel Ortiz , Jerry Shih Subject: [PATCH v4 19/20] riscv: hwprobe: export Zfa ISA extension Date: Tue, 14 Nov 2023 09:12:55 -0500 Message-ID: <20231114141256.126749-20-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231114141256.126749-1-cleger@rivosinc.com> References: <20231114141256.126749-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_061358_948297_B7F9F905 X-CRM114-Status: GOOD ( 11.10 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Export Zfa ISA extension[1] through hwprobe. Link: https://drive.google.com/file/d/1VT6QIggpb59-8QRV266dEE4T8FZTxGq4/view [1] Signed-off-by: Clément Léger Reviewed-by: Evan Green --- Documentation/arch/riscv/hwprobe.rst | 4 ++++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 896ecfbbe5f4..41463b932268 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -157,6 +157,10 @@ The following keys are defined: defined in the RISC-V Vector manual starting from commit e2ccd0548d6c ("Remove draft warnings from Zvfh[min]"). + * :c:macro:`RISCV_HWPROBE_EXT_ZFA`: The Zfa extension is supported as + defined in the RISC-V ISA manual starting from commit 056b6ff467c7 + ("Zfa is ratified"). + * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance information about the selected set of processors. diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h index fffc69d9f6ba..91fbe1a7f2e2 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -55,6 +55,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29) #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) #define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 31) +#define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) #define RISCV_HWPROBE_KEY_CPUPERF_0 5 #define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) #define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index e90537593f5f..f0bd7b480b7f 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -193,6 +193,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, if (has_fpu()) { EXT_KEY(ZFH); EXT_KEY(ZFHMIN); + EXT_KEY(ZFA); } #undef EXT_KEY }