Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp999754lqo; Fri, 17 May 2024 07:56:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlylu5kGuKMZvgZx1nQFy1D26Sw7+KtT8zi9o+2OUvuRZ9Fk3XipvLmGy5Umnw+IfRDu0dcFOWBoZwdkxDhsWWd4cMRyPZGytuJvUukA== X-Google-Smtp-Source: AGHT+IEQ+sq+4VXqwvBsNzbK7GryQXK28ZrVsmr60JqV/KRcwPATOxE3z2qjUAu6pFqi1N6wPhz8 X-Received: by 2002:a05:6214:5404:b0:6a0:56ad:7d08 with SMTP id 6a1803df08f44-6a1682323bdmr265008866d6.43.1715957806667; Fri, 17 May 2024 07:56:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715957806; cv=pass; d=google.com; s=arc-20160816; b=oXeQEMFtXc7+4XQWXPU0BIBrLLAzXYYGPmi/qJCBMuX7PARN9d0GLX1vdR5K8jwPZZ GUWbsHlEXajpMfN1fQ1u2tiaZVn3Jy1/uc7ZkLLOHKP5vE3c1sZwt5qlkJkyQ4g8qcG/ +jpIJBdtPqDozT0qKl+NfuevjqR4aKZ+IYifAnEIAsl9aSjisyN9/e1KCU66pAz8Eu1c xWqMovLB3ZALizz4X//vbYyCTAjHFNWnADIuRAzEu2oqacXfuAdsxWY40kxRZyURxtD5 6ZTx8P21lmB9ZrYnbSSZ2LQcAfG2KP6v8osbvaJ5ByQELGlgX6TxIf5C4nqasWmmfuYV eteQ== 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=6ZcvU9Yv1rOWLKDlgsJRQ29S24RYbUTnQ4T9H9DZeCs=; fh=isqirpEbfZg+/3778MHcGGheG82mOjdjfpdN9baxZOs=; b=bKWGdWUkHm6tiP6yCB1PTPytxzcb23eBhiwbRD+XnjHNWgTrEo6VPTPEaRlC7TeKef lJ3bpVfYQnbS5uJ0SYmI0hLTnKVuzICO4D+IOFdlMxqvPj/DmVmuAqTRPaeqJIHzrp1T mtuVX3szJ4PL1pvr6lm4BEhfVMt+EhlvfEA2N+kg19ZNYZYCZb8DZKGqJXvxAKTKAptI SczRUkYdaSsVbHGgddWiHoW2/pHBBt+XIk3p6XvPVQV9qoS9n02kzjjgP4mEeYa7LqNh 52QZnx01DKPMco1w4m40lek+zxbS+LxMT481XC7/dFZQuibfXIQM9bprd3ViMtDclcGq eQQg==; 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=UdSglax6; 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-182248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182248-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2b66d7si196757376d6.347.2024.05.17.07.56.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 07:56:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=UdSglax6; 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-182248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182248-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 545491C21A55 for ; Fri, 17 May 2024 14:56:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C9FF78C85; Fri, 17 May 2024 14:53:32 +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="UdSglax6" Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 0F40F757FC for ; Fri, 17 May 2024 14:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957611; cv=none; b=Pk/g4NPO1t5CKul6cHwNmTMk25yabjXM5Rq97TG23TmLgQCwIRIIMHOAIK1H+qNNZarNnBqXiroZTPaHfSMbi9ZqQDi5z1pJxC2Z+k/5+91geVaPbfuNccViAfGuDim6d8pWfxB2amxYhd85ixP/eXQzhsAGt+BmDl1MtjQMEcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957611; c=relaxed/simple; bh=eagQAECzO2hi4eNtQCPhd0tHFgKGQg2VQEsmUNc/frk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a0D0wpkeMpMO9dAfF3qmWt3zFw7cnWdQkqbMzTKaVgbaUgZzerw4vl8k5MGNl8LvB6XTh3ZJrk8c4P/RCdtFmtmLlgyuAfi4Lr7LCqn0+N0DRpwtiEd0AIBu34qmfxm9NOLoTjOqzxqJ14WNLoCcD/oB2FY27TI2ATppv5om1Hk= 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=UdSglax6; arc=none smtp.client-ip=209.85.208.179 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-lj1-f179.google.com with SMTP id 38308e7fff4ca-2e20088184cso3324231fa.1 for ; Fri, 17 May 2024 07:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715957607; x=1716562407; 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=6ZcvU9Yv1rOWLKDlgsJRQ29S24RYbUTnQ4T9H9DZeCs=; b=UdSglax6OzNRqIZ9f/fg1l8KSw4m/fQ9w9x7oAy6CSZE1uGLYJSlNEznVW2q2U09UD YLVABUg33s0tGJ8cL0nQ/J3X9czyuMK4BpWuxJpMkJRtQO8rywF3B9bzNUxsOTIkq9FM r+t3mSe/oC2Vdhu+KUv0BydYVv3iFIPMsc3zHUDkfJwnvxPUm65YNR0wi3I1qkljCYRi p02/GRRvMoHJfQyaAxCEp+l11jdcY33kQLGmk9DuNHY89VonkJ5hdB0fJQI+G3ZrDj1o COVZtVF8ebOSm+UDm/Ms9NX6i2axZai6ujmZCgCZHURiZ/yKq8oKwK/FFbeSh/lZl+rB Kk6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715957607; x=1716562407; 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=6ZcvU9Yv1rOWLKDlgsJRQ29S24RYbUTnQ4T9H9DZeCs=; b=a0+bJGdK4x5Zv6t5qF4i9qdSbnEBXiwnKTFIPO4RyqFrxz8W0N0JeX4g++q4hmR8FO HU+ZwRt+AGw1pY6nuSPrm4vSnEsLMQRFtgskbERO8FYAbpwRUCZ4JmuyPBnILN30DReO eIiAfwsMryyLRMBssGiwHCol7jTmc0u6V6ivnbiUFwT5ttWVkXGMHVvyipeQRNxQieU1 M+8Un+pEeFYfmYMSsInFv+ASKimPlBjPOPijYPYc01CVL2CgqHsLPQw68QIRT2nGQtqK J9Le1V5PjtEoR6OKgQf9uHnV9FDXwWC+2suS5v3W0uiOGggsYV1RB00b7S4/VXSaE5bi Q/FQ== X-Forwarded-Encrypted: i=1; AJvYcCWpXAO50J5NqytpyzVMIj4Y8GONHddDvr0OtXUKGjsRdcbtK+IywDOxjTR/7fcEwHkzQRQPDizysJKFjXMUfJx94ec284ktS20yuImL X-Gm-Message-State: AOJu0YzJpkkwaJSriH35hSHZFe+ykCj+vnCy3ExRTYDgYUYGssNwn8nF 4dkJOOHgBvzbgzq8Prl1ogh+OsvPeb3Nns4QwQ81HHAjO0PCcekSh4Rq18GFsX8= X-Received: by 2002:a2e:a211:0:b0:2e2:714c:23d2 with SMTP id 38308e7fff4ca-2e51fd3125dmr162327021fa.1.1715957607233; Fri, 17 May 2024 07:53:27 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:46f0:3724:aa77:c1f8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccce9431sm301723695e9.28.2024.05.17.07.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 07:53:26 -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 v5 09/16] riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions Date: Fri, 17 May 2024 16:52:49 +0200 Message-ID: <20240517145302.971019-10-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240517145302.971019-1-cleger@rivosinc.com> References: <20240517145302.971019-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 48be38e0b788..cad84f51412d 100644 --- a/Documentation/arch/riscv/hwprobe.rst +++ b/Documentation/arch/riscv/hwprobe.rst @@ -196,6 +196,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 3b16a12204b1..652b2373729f 100644 --- a/arch/riscv/include/uapi/asm/hwprobe.h +++ b/arch/riscv/include/uapi/asm/hwprobe.h @@ -61,6 +61,10 @@ struct riscv_hwprobe { #define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35) #define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36) #define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 37) +#define RISCV_HWPROBE_EXT_ZCA (1ULL << 38) +#define RISCV_HWPROBE_EXT_ZCB (1ULL << 39) +#define RISCV_HWPROBE_EXT_ZCD (1ULL << 40) +#define RISCV_HWPROBE_EXT_ZCF (1ULL << 41) #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 fc6f4238f0b3..11def345a42d 100644 --- a/arch/riscv/kernel/sys_hwprobe.c +++ b/arch/riscv/kernel/sys_hwprobe.c @@ -113,6 +113,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair, EXT_KEY(ZICOND); EXT_KEY(ZIHINTPAUSE); EXT_KEY(ZIMOP); + EXT_KEY(ZCA); + EXT_KEY(ZCB); if (has_vector()) { EXT_KEY(ZVBB); @@ -133,6 +135,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