From patchwork Wed Dec 13 11:33:01 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: 13490784 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 73379C3DA7A for ; Wed, 13 Dec 2023 11:33:33 +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=2BpczHF92VmXZO7mOAgFB1CrKZulKm/ghrFlYZ4Dd4Y=; b=bkqmQTUhk85HUv htow8GNR0kRo2v/k/6av3SOPsmnPDlRVRH5C54mt9m2goY1Sp7zcFN5jnJURugljB8YSgBtPe9T5r FJIr/WWcLvgZNvn4adwN9LMeXtRtDxTDj0eq42zr17jgcsIsGMBLNJwRpZa2IHDApdyKO8Oqd8/MW 0k3ClEHhrv4FYRKjkh11oCK9/V0SywO30ZAYfQCaaFGnQB7YkhhEMVlHYOX4NbjrhRl73XJbumwWG Fkw33O8clPTDXcUTf+JM2F44l5EPdpVn1rHGQKfuxnlfnHVlNawx4m0iWqwRN2MAS1plZYxNDnXxr lrxvncMi8FgxasyqGv1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDNUX-00ETBq-0F; Wed, 13 Dec 2023 11:33:29 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDNUQ-00ET37-1d for linux-riscv@lists.infradead.org; Wed, 13 Dec 2023 11:33:24 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40c1e8458b9so11300285e9.0 for ; Wed, 13 Dec 2023 03:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1702467198; x=1703071998; 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=N3Huv5MEBJaGZczqd/5TE8MmVw2Iifvm3SE9MHyvArM=; b=ARNgD2H3kgd3ToP8iInjkwZsmoIpA2G0EYEvODkuMcj9NOU78xRoQ36m5Zwlo6HrgU oa/eReVm1rp49P7LiJ0MkGueaWKplTmraxKQDhvzlFI5cfXrAhTRMCe8JfRmc1ByvNgc f9+lK3WcJlWrTr+Cm6qZeRKWV2RvsE447U63gt4GLZKPbA0K7135b+/iZyW2juOrEq0a Pu1qRod+JqZtt8WTPBXPlmAmH+1bMfXZcMkr3C1SwVb9RWLrBhr2cav/7oq+RoHItxZJ a8EwixeCpwTrXKnsM9omlCVSAa//yannuX/tjvzGE0ASbdGPI5hOY0EtDjtfAgtPh0yB OEKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702467198; x=1703071998; 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=N3Huv5MEBJaGZczqd/5TE8MmVw2Iifvm3SE9MHyvArM=; b=eaPpf7N+6B6UaoAtNCM26WsQiUydU1Mo/0uzdNEWE5q+ZXAg4491kdhl+OemV9SyE9 H6yv5F2lsV/su8XY+3vvIhko52qgszqyeOPyZKH5gnVRPTFDw/B1nwgHc4tu/P1b3qGb FBDNcfXjSGv7FpA2DhgxtTdzsAxKMi70yzIs92ZYSxk+bf17jb76K+2FGMoHYLPJ8CgO LkKiUek4V3vwVZhnXJc8UnXUvhlD1CXnpoG4dQRjQY07q1K+3S99IcjJjCCAj8jUDj06 rbJ4IBTP6IzOM8gC+GHlY15ZJzViQui/+KWjj+UAbLPxGZOMVF/qOekU4Een1royIjYY c7Og== X-Gm-Message-State: AOJu0Yyvva35bhq4PhBEDo8/DwEKaYXIaXFzGHDSBZGalZad48b6ty2u kQfGXATcCXuJdrUBGdNPu4Lp9g== X-Google-Smtp-Source: AGHT+IEuw1QBTiAznUoQrReEOynJMkbQ+ARylSUzX7QvBk7zRYceQKbxX1KCoyBCOFTm72L9SeyM/g== X-Received: by 2002:a7b:c411:0:b0:40b:4f49:4a33 with SMTP id k17-20020a7bc411000000b0040b4f494a33mr9613789wmi.4.1702467197998; Wed, 13 Dec 2023 03:33:17 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:c564:f167:d072:5672]) by smtp.gmail.com with ESMTPSA id m27-20020a05600c3b1b00b0040b38292253sm22433137wms.30.2023.12.13.03.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:33:17 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Robbin Ehn Subject: [PATCH 5/9] riscv: hwprobe: export Zam ISA extension Date: Wed, 13 Dec 2023 12:33:01 +0100 Message-ID: <20231213113308.133176-6-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213113308.133176-1-cleger@rivosinc.com> References: <20231213113308.133176-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231213_033322_593416_4BF1640B X-CRM114-Status: GOOD ( 10.62 ) 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 Zam ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 3 +++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_riscv.c | 1 + 3 files changed, 5 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 10bd7b170118..9b19ca3433de 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -165,6 +165,9 @@ The following keys are defined: defined in the RISC-V ISA manual starting from commit 5618fb5a216b ("Ztso is now ratified.") + * :c:macro:`RISCV_HWPROBE_EXT_ZAM`: The Zam extension v0.1 is supported as + defined in the RISC-V ISA manual. + * :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 01ac3dc196e5..2350c45741a6 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -57,6 +57,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZVFHMIN (1 << 31) #define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) #define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33) +#define RISCV_HWPROBE_EXT_ZAM (1ULL << 34) #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 6564fa9e7a7f..a8473d7f9d1e 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -175,6 +175,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZKT); EXT_KEY(ZIHINTNTL); EXT_KEY(ZTSO); + EXT_KEY(ZAM); if (has_vector()) { EXT_KEY(ZVBB);