From patchwork Wed Dec 20 15:57:21 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: 13500315 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 7979CC46CD2 for ; Wed, 20 Dec 2023 15:58:01 +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=4X0rlxMH32JN0KBubIbpTJ9Mc9UTvUkbxvN2YqBlEeY=; b=sQLrTlhMC4ZtcJ iECmR9YHsnldGvODtVCCFUuWW/+m09tmt8/AZizwUrAW96d9lO6RTI7TfNWQ7zt+TX4WnpxPX80ou +cWcOmfIkNJ+GU20RSwNyVk5XmGfW8ir3booBfCi/9giS3laK97mhvjw2w1TzvHLySKtRvMCQ3hpl AIwPR/LyaZPMpZetrGD6OtXgGYnNKEWRC4RtteyUGNlo/wTLLObLV6udbfJRV7rTSi0cYiYFR8Fcv DUI5QpymH9IAPFSuK5T8DWC5cGIMaXBUm6pMBXsNzzqYedefS9q22D8JPTQcVQ/pAofCP6CZnkwFm dx7BVyVufQjh9qMyFEhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFyxI-000KPh-1m; Wed, 20 Dec 2023 15:57:56 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFyxC-000KKS-11 for linux-riscv@lists.infradead.org; Wed, 20 Dec 2023 15:57:51 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40c32e205fcso9882015e9.1 for ; Wed, 20 Dec 2023 07:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1703087866; x=1703692666; 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=3BPMv24jdGVieLmHRP/43iA/a2qmOUrYJR1MkKgXts4=; b=nHL4rj0shMRFog8OMig+pIfQ3emZC3YfGxFWnUcTcQUK/6KSoDthnUunaJ6C7Lxz9B mnKAX3+lc786NIRY9XvWWgi/66WlSVRXit+t5wcVLDq23SR7q7d4tDM7g7mINnBKLhuQ gAqO362nZhRd5Isrk1KuLnppIKRQauM9CWUrO/OJWYLRe1Ct0OEXgkh9GHrbeBocqPOs QdrwJihre3vCpQaeLULTdatQtJ6FUPdYlt61+njqea+7Zm/nG6lPKV4w/pLa3csJZWry 1lpbhOHHpkEl+1UoDoEgAdpiuJbeVlxztzExFF8CrHwuSf2iQFteq48DfdJtIpUB8pvn wvpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703087866; x=1703692666; 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=3BPMv24jdGVieLmHRP/43iA/a2qmOUrYJR1MkKgXts4=; b=AtdG5EMH8KIGYcYy6Kph014mYkuDlsuGH04BCHa2SpP27//JqG87p0nmpn/JXjhp0x xvV56lFlSQDAnqn9/140eQTj/pB7OmRbJF67abLjJIftW0g6I3KRZNUVb/sjUVBK5TU3 MONQIk1At0LyHZKhrBeMxlo2hrRbOJMBP30rWPh50FVlY3L3zuu0+XTrmf6e5lZILANH fWekl7rZ8rhC1hTH+sUOpwyJU3+vxB3yF2AHu1ho1SjZqcjh6oE8SDVOge2CdHSflQzl l+5uUgvKVRlw7azMJAITs7P4DoSfqP97wjCiYD5qXwUFdx8apyxM+aPMqB2hGw3v203o htog== X-Gm-Message-State: AOJu0YxJ5wpFSwJv38fbgd1y+LoelTZe1KVw7Ww6ysG6az6ry37jtgAs EspPVb+0jjMGq6MT1On9aX44kQ== X-Google-Smtp-Source: AGHT+IHhRAXXz42/u2vdF2rRn+pcNPzJD+CGhaPX7dsedwK3pxf8bg5I86xeWYEngCYQhOlYz8+CIQ== X-Received: by 2002:a05:600c:3b98:b0:40d:3880:b046 with SMTP id n24-20020a05600c3b9800b0040d3880b046mr1065572wms.4.1703087865822; Wed, 20 Dec 2023 07:57:45 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:3eae:b70:f27f:7aa1]) by smtp.gmail.com with ESMTPSA id h18-20020adffd52000000b003366af9d611sm7279693wrs.22.2023.12.20.07.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 07:57:45 -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 , Gianluca Guida Subject: [PATCH v2 5/6] riscv: hwprobe: export Zacas ISA extension Date: Wed, 20 Dec 2023 16:57:21 +0100 Message-ID: <20231220155723.684081-6-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231220155723.684081-1-cleger@rivosinc.com> References: <20231220155723.684081-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231220_075750_358054_91E280E1 X-CRM114-Status: GOOD ( 10.71 ) 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 10bd7b170118..bff68004ad43 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -165,6 +165,10 @@ 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_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 01ac3dc196e5..ac65bb43c8e7 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_ZACAS (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..6c680c75ac0d 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(ZACAS); if (has_vector()) { EXT_KEY(ZVBB);