From patchwork Wed Dec 13 11:33:04 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: 13490783 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 2747BC4167D 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=jbd3ApkJUcLoS+dL4PjzxHF3AxKjRu2C0E1KsLOP31U=; b=rlNFBvA5bVraVx g6+wu41/9l7uMBpAmwvEWRWBTdWXOd6HrrBA96fzwAghajJMfYh+8J/Fcy0cMnd5jIuW/p0kSN1q6 0K5DBTGX3oysO9hPR3+9c4mmKl99zPEU0//r1bm1wvxbbrVt0c+v/YiSr3skSFmdyPFc7842IYpZm 78h1cNwcfg8SG27cRLCYyiNLKl1J7so7M6DIF/AYtjekyafFN6hHU/mmdMUHjT32DMGy5HU/UvVYT DxBVniimOWFCnAyRS1paLfm8Kwt+pXv08ybnB1QKrfGTfD9VfTp1AVm2bzteLYdVWsqCEuObpqoZO J2cw4EK1k8J7ACTPyXdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDNUW-00ETBO-1N; Wed, 13 Dec 2023 11:33:28 +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-00ET5w-1j 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-40c192f488cso11231135e9.1 for ; Wed, 13 Dec 2023 03:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1702467201; x=1703072001; 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=OT3PabJ+SN8OyyxUlhRHLBK2j0fBOpZosf39djft3/Y=; b=N8Vo23KCZDSntkDv7eaN0bEDEl70axMCiFWXLM/XJpjo5sGw27FJop6c0DOVVG4gu9 VJb3YOcjx1ahDdx4Bo/7sUQlHMaLexMvMWe7DvauHS8jYcmBlyXzoHXNu0dGs0s6EshK ucuwqfaz9ulBJfVjcdo5w4sABw8F2hWxIo7nlr3azQ9sscZ/oCU/MvqxtAy5C4+N0QyZ N/pt4zFry2nPSE1Mt0jRPM4k8f+pkoYMsw5FrTrtXrCC8dGoQI9oS9MXGC1SlraUIppq shBfJ1n+gZEZ9/U12i3qwW1F2LcA4z+C356uM7WgQRfm9SYbyFqL+cS4YaK/Y7JQ7w9z t2eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702467201; x=1703072001; 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=OT3PabJ+SN8OyyxUlhRHLBK2j0fBOpZosf39djft3/Y=; b=a7ER7MIwxxzZpeYEVJDlm+Q/LbNDAiBfnbfQA9Qmg3g4DnXMLslUqwTbDjB5xXlBVw AeMB0BfJ6sQoUFndLjr8hC35vEnYdZnI+gNKcFXwXH+U5VSY2SxaMdvJW8Aiu4vgs0GJ CbhmOVP/UbcVG32nnChDlyeGosT9E4F4WBe9RjMvfnUKIRlDHFuOniRvmmSEDWdkB+ao DeD1n2xE9qZXrTsfsu5G0/3qXlijz9fkfrM8I/i3wpSvQC0x0euCHhzs0pv0YdSxC5HS 75MNM7GTFLPvfPTJ7ZGIsgsMT7oKgLNV0ThdH0BKxIijpoZob7MnBfFxwV+Ja+p6NKvS 3JnA== X-Gm-Message-State: AOJu0Yw1TRH4yQU4OlTiI1TNKeFuZTlpTlJqnkE136GVcfpHwVnrh43C uTjFSbC6vK3SzxHOYlkXmNpaJA== X-Google-Smtp-Source: AGHT+IH9GmoMwESHe8vAwJ7aLTEGq8Q2sisRnckD+tr/gJXlhQQcanfZ3+mQWdFY8OH3kjBBZTEQBA== X-Received: by 2002:a05:600c:35d6:b0:40c:b81:c640 with SMTP id r22-20020a05600c35d600b0040c0b81c640mr9664241wmq.0.1702467200958; Wed, 13 Dec 2023 03:33:20 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:33:20 -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 8/9] riscv: hwprobe: export Zacas ISA extension Date: Wed, 13 Dec 2023 12:33:04 +0100 Message-ID: <20231213113308.133176-9-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_603903_78CC2E94 X-CRM114-Status: GOOD ( 10.34 ) 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 Zacas ISA extension through hwprobe. Signed-off-by: Clément Léger --- 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 9b19ca3433de..510e49878834 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -168,6 +168,10 @@ The following keys are defined: * :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_EXT_ZACAS`: The Zacas extension is supported as + defined in the Atomic Compare-and-Swap (CAS) instructions manual starting + from commit 5059e0ca641c ("update to 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 2350c45741a6..7ec4331122e7 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -58,6 +58,7 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZFA (1ULL << 32) #define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33) #define RISCV_HWPROBE_EXT_ZAM (1ULL << 34) +#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 35) #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 a8473d7f9d1e..abb0eea3ee08 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -176,6 +176,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZIHINTNTL); EXT_KEY(ZTSO); EXT_KEY(ZAM); + EXT_KEY(ZACAS); if (has_vector()) { EXT_KEY(ZVBB);