Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2914203lqt; Tue, 23 Apr 2024 05:45:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxqoSUbomu0nIfalaAQIfN+4gMgIlXr75u99FTjm2Jxw3oc/IzbN31SSFKt7iYPc2TDCxq7x630wYOnzk22JJTgQEcIWgNRvt0vQoCHQ== X-Google-Smtp-Source: AGHT+IGR7y5OiP2TMLWALg+dv4c5d23TMhjeOUO8KxH7ZMQKUu7apbD09Tr/U2AO4fYz1XQnBhaR X-Received: by 2002:a05:6512:55a:b0:51b:6d63:e0e4 with SMTP id h26-20020a056512055a00b0051b6d63e0e4mr3077494lfl.29.1713876331381; Tue, 23 Apr 2024 05:45:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713876331; cv=pass; d=google.com; s=arc-20160816; b=QcN8TPCrcU3QiH3dOA6vKF5HC4FmpVLBelSOBqE1Gz5SFH4b3VXH/QTNomtq7zyKjZ /trMxrIsZRdFyQm44yb7OoFbzQ5k11NJ1m7I1NMu+evlPZol+VrFFZ+prYN3+SPFAp6e U7iYa/4wSEyBqWIwigr3LZlYLz1J+fwa/rzsyxe9go2N2rL6DO6C/eo5gw1D7KVnxwfn y6mHx/o9TDzZ/lYNG1BzMNwXG7/77VmqK4XYiEthQUkMjW5DNtgsOJq8HblmyEMiW8T0 8BbT73zvhZ7rm0UyqKaFngsn68BrrJ4kz7bUa+99NDvuMeTN43v0vAPWn8Rb3UvIdH5k cnnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t82SHWSKnQwBrCB557sYOimgSCzDvuCob+i4t0Pqx/Q=; fh=2ey6o0/M9F+onJQellSSFuXoyDc6l/OYk4Nu1kA1r4o=; b=adpaJz78KCbnZYJBdzXn5Stdtkwdyh06jF/HgVKe0KubR0XCEnYCLEHXK/XJzVA0DQ ZTl5gRpezqIYjU06OPrR8EQxg+Qes2sIe5/xc+SvLTgbLjxNbIh/corwUaahyqwGa0k/ VTcAq2M53mvTi8YbHiEKS1D9JrDkoXh5q/et1lqt3LM3d+pUhvO6X7umox6qqVgZMUtK vV5t1TZJhrgyIgFD+TF2Dzi8RTqZSdjlm/vnu1AYBZY5xrMjmpyLZQtRhV8TqvLM01l0 Zot3ONGgTLlRjYNnnn0c6vsNTDOjthLeoLIKRKg9NammcEI4vdoipAFebD9ThluZDp9r 2dQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=HfOtS9PG; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-155199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155199-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hg4-20020a1709072cc400b00a558efa20e5si5698174ejc.921.2024.04.23.05.45.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 05:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=HfOtS9PG; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-155199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155199-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1C5C81F22337 for ; Tue, 23 Apr 2024 12:45:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AFAA131E3A; Tue, 23 Apr 2024 12:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="HfOtS9PG" Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33588132C0C for ; Tue, 23 Apr 2024 12:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713876230; cv=none; b=a+Ihw9R4lKGOAidR/JGXRBagwtgdwcIL+JAqIXWfk/5tZzE6qWcfQzxzTbATyc/NdnHGurW2MgJkmxL3rndH2SEfufBNDTaId7shtewm/dCe+7wOL9ZzrTUt9wle7O/vVY4Yzax6E5MDFzuZWFpsvNLugtu/UsMSyt89Q3HX9JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713876230; c=relaxed/simple; bh=l6HwQhAS5cBw6tUNZ3QEVVTb2yliEfsikw1VTQcl4U4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z5dPdljCdOp1DWVeK0MYNNe9SK86WI9Uk2/vdecUe5JZmewVg2MfOIuGgA8wwxTeM1QTe5K4qeb9IDMxLf83BExi7r5dCcNWQ1go1RdnDT/QLSW1N+++1vGgWqN38DW0edWpCcw5tRLrebirwuaEIMqyIJezIS6IHkX9pOGf+dI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=HfOtS9PG; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-346a5dea2f4so1223483f8f.1 for ; Tue, 23 Apr 2024 05:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713876225; x=1714481025; darn=vger.kernel.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=t82SHWSKnQwBrCB557sYOimgSCzDvuCob+i4t0Pqx/Q=; b=HfOtS9PGpEu345x+8F9DY1uSF+0Nad2HEo5H+69CLA0/USVEVRqCnmp1O7fN5qpXgl dxF3j/oImsyztFKh5FaPzownmWBltqbqzDyITEtUPH4Ac1jFPVAsxWWEcFos7U4fhm9h Fbjlz9QeR77fDRx5AjCa2cvp3xl5Yubds7dG/C6qDUMg8kZmqeHQrN8lO6xCcm9poow7 sEZXKC17CpCDZibnerNckDyWYXN5OpOkye6Hj02iMrjKmPwgBBD43gxftDw7NTwJ2lSn Oa8rzl7oKUZAIemB9+xkf8sksbnGHUuYx+JPIcjwvWvMmb3PMc99RY8VL8SoZCHVy8Cr 3mvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713876225; x=1714481025; 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=t82SHWSKnQwBrCB557sYOimgSCzDvuCob+i4t0Pqx/Q=; b=xT7KwKpINWAmdln8PRdHfLiRhoOJ0czR6d8dbmohuLSzzmOb8ctQJQyCFXuXLsTq9X /sz4nviOnZCNxW+WPHl0NpWJMbjuvv/5IDDPApf4id9gh/pIQxSiS3kpSL2B8+G7PH8U LDJuNJkqm6X1hHmfnH+B1ezFJjDuezh16E7x8p6MH1/dZBEkwKZhZ6nxPzHF9k1zTIUZ mW4bevxygoAGF/4oEzbLtgNismzMcZReiZjVo5k/BwVfsha3yizzxkWgZqELjWj4IvIr oz03x34wEFGeiCVIMdg2NJ+QISqFMu6tdjT+z9Uw7Tq55z4dmTHYG5ckGTgXqjbaMiSc F3iw== X-Forwarded-Encrypted: i=1; AJvYcCWaQMAegkcFkGF0twqKPpcTzNIBqe3RgCzCi8PoEjg7FhfZ9XMoJI8fMWyFvOI/BDIMxNoNaO69LKyAPod0DEirtUJrQnA4yZkAa5SX X-Gm-Message-State: AOJu0Yy6XjaKsQWgnpCIzV3luklVKBkEXmGsg1Uxhwycr1/++yxWfE7w LFqHO4NlOtE3M2uHwgIpoXo/+nH4E5Z4wwd2EXIZIszdlT+/tvDnPVgV06GTONw= X-Received: by 2002:adf:ce02:0:b0:34a:f7f8:807 with SMTP id p2-20020adfce02000000b0034af7f80807mr5046634wrn.5.1713876225582; Tue, 23 Apr 2024 05:43:45 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:71cb:1f75:7053:849c]) by smtp.gmail.com with ESMTPSA id v10-20020a05600c470a00b00418a386c059sm19975709wmo.42.2024.04.23.05.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 05:43:44 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Atish Patra , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 04/11] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions Date: Tue, 23 Apr 2024 14:43:18 +0200 Message-ID: <20240423124326.2532796-5-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240423124326.2532796-1-cleger@rivosinc.com> References: <20240423124326.2532796-1-cleger@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger --- Documentation/arch/riscv/hwprobe.rst | 20 ++++++++++++++++++++ arch/riscv/include/uapi/asm/hwprobe.h | 4 ++++ arch/riscv/kernel/sys_hwprobe.c | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst index 9ca5b093b6d5..bf96b4e8ba3b 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -192,6 +192,26 @@ The following keys are defined: supported as defined in the RISC-V ISA manual starting from commit 58220614a5f ("Zimop is ratified/1.0"). + * :c:macro:`RISCV_HWPROBE_EXT_ZCA`: The Zca extension part of Zc* standard + extensions for code size reduction, as ratified in commit 8be3419c1c0 + ("Zcf doesn't exist on RV64 as it contains no instructions") of + riscv-code-size-reduction. + + * :c:macro:`RISCV_HWPROBE_EXT_ZCB`: The Zcb extension part of Zc* standard + extensions for code size reduction, as ratified in commit 8be3419c1c0 + ("Zcf doesn't exist on RV64 as it contains no instructions") of + riscv-code-size-reduction. + + * :c:macro:`RISCV_HWPROBE_EXT_ZCD`: The Zcd extension part of Zc* standard + extensions for code size reduction, as ratified in commit 8be3419c1c0 + ("Zcf doesn't exist on RV64 as it contains no instructions") of + riscv-code-size-reduction. + + * :c:macro:`RISCV_HWPROBE_EXT_ZCF`: The Zcf extension part of Zc* standard + extensions for code size reduction, as ratified in commit 8be3419c1c0 + ("Zcf doesn't exist on RV64 as it contains no instructions") of + riscv-code-size-reduction. + * :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 ac6874ab743a..dd4ad77faf49 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -60,6 +60,10 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34) #define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35) #define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 36) +#define RISCV_HWPROBE_EXT_ZCA (1ULL << 37) +#define RISCV_HWPROBE_EXT_ZCB (1ULL << 38) +#define RISCV_HWPROBE_EXT_ZCD (1ULL << 39) +#define RISCV_HWPROBE_EXT_ZCF (1ULL << 40) #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_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c index c99a4cf231c5..2ffa0fe5101e 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -112,6 +112,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZACAS); EXT_KEY(ZICOND); EXT_KEY(ZIMOP); + EXT_KEY(ZCA); + EXT_KEY(ZCB); if (has_vector()) { EXT_KEY(ZVBB); @@ -132,6 +134,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZFH); EXT_KEY(ZFHMIN); EXT_KEY(ZFA); + EXT_KEY(ZCD); + EXT_KEY(ZCF); } #undef EXT_KEY } -- 2.43.0