From patchwork Wed Apr 10 09:10:55 2024 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: 13623923 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 D743DCD1296 for ; Wed, 10 Apr 2024 09:11:41 +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=8DPQTJ9I3jZBDPwr2IK6SJhiJXDEATrFX6C7Ib9c0cM=; b=qyDAzd11OGRz20 SnQuibaE4qitNr1CJBp6BQb2fam+N0buJwSc+I5+FEcPhKqwR5irPZyHGlDzfA15j6PM4mScRNXul baAZObimUb/yXrlBbaQysSNF5CLCvp2a11NQdNVkC2wD7cJpUaqNOlLrbMTRY4Kd8na2kAnfX1swH CHdV8LulQa5vep4aE90wrWwfl2Gu99RLkn1+YeXXqQ0wr7v6t9kzh4CRmRmt9QPW9kkuYOm36zqC9 h4nN52CjsxoVtGDHIlsSYid6UhxVI6HDoEzAJ3GijUemYOBKofr10W1Y23Gd2+hjmGU6rJcyyfjpO iyaktCg8Lozy7+wzvnEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruTzI-000000063DP-3jK0; Wed, 10 Apr 2024 09:11:27 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruTz9-0000000633E-3Hqq for linux-riscv@lists.infradead.org; Wed, 10 Apr 2024 09:11:18 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-346407b8c9aso516551f8f.0 for ; Wed, 10 Apr 2024 02:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712740273; x=1713345073; 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=hAM+PbC/Wqgx6Q9RB0x39wuP2KdW0QgVrrLDnXaQ5i0=; b=ubQwOxNGKKAItCKdWmXF12Y7VfgsnpoY0pJLNMFjp77gMiAEs+mZPFGNaW31fdnPcp cDKJY1rnWAFBjlp1pfDNhwt4chbuF9+H9NKhTjv2vwLmCNCfilHGEy8GAIcKlsLz45nX qTj+g3s+k28zot6zuyNtRt67CoB+uVkh8fGlOl0LB4E49JErJvbUmys2x58uXe6tQ5U5 0S5HSAOQxWRpJz/kcHqI/YJL0XwUNzWQU/ElMu0AShBzCOq+LxJv8UOqBk3gvsoN1URx NBri7qBBZtyEignYbIGgZvfWBtwVbtoqDu9QV+JrG8CG61lnycFfE9yioPTB5KB4hqWY hIrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712740273; x=1713345073; 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=hAM+PbC/Wqgx6Q9RB0x39wuP2KdW0QgVrrLDnXaQ5i0=; b=DybqhPco9Yi5xS7PIRBnRyi21Ph5KlXoY6U06AG5wEPA8Z+ZVxJxZIZS/OfxNaKLDf SSM1Mfm4bEvswsJ7/emPsKOnJwHdONlcPCdfQlKpuy6yKDYzmMt7kuz3NijkQRLGhu94 JY1WQ/g/uRtIDROtRyk6pV8Fk2xb02uNxvhEaVgrZXfMdgliSQNrGrKUvvw1LSi7lD78 zqb6+a/YyTxz4P561HFrsqVAZDgekck0GtujaHXyD7J0dQaw+bqtFg2JyGmxy2U/QQ8T S4T8hxcUJpegrwMhlx6odYwodKripd2FeuyQVrmc2Ev4oQpE1zSJD2ZC62G8XsABAWip NpPw== X-Forwarded-Encrypted: i=1; AJvYcCXk2I5aOgipeW4gpD0J1F5YQjkSp8AAbREwdly99fEzF2zkwiaziWhrR5GcGXTj0vs3jLyG/xFqVaeaCT4XvqZ7kC96QwgQ9vQOdzeMA3Fq X-Gm-Message-State: AOJu0YzBzyYZRlNZaA1Mt960rMomshMVdg+hpSjJusjWoS8MubIp8p7I Re0DgSfC5N+ij7faYnIh0KLzjt6x3I4i0IJLZy/j1vuyo1uQCHefLks+QrQUmtk= X-Google-Smtp-Source: AGHT+IE31xyXAQiWXlldG2UNnWUTBPkwaZr0QcS45UwtURwADr+zzFGrAFhVxk0eW5d0FTe+jo+2rQ== X-Received: by 2002:a5d:4a4e:0:b0:343:c3b0:ee39 with SMTP id v14-20020a5d4a4e000000b00343c3b0ee39mr1259281wrs.5.1712740273042; Wed, 10 Apr 2024 02:11:13 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:d4a6:5856:3e6c:3dff]) by smtp.gmail.com with ESMTPSA id d6-20020a056000114600b003456c693fa4sm9079086wrx.93.2024.04.10.02.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 02:11:12 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 02/10] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb Date: Wed, 10 Apr 2024 11:10:55 +0200 Message-ID: <20240410091106.749233-3-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240410091106.749233-1-cleger@rivosinc.com> References: <20240410091106.749233-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_021116_913312_2984B982 X-CRM114-Status: GOOD ( 10.10 ) 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 The Zc* standard extension for code reduction introduces new extensions. This patch adds support for Zca, Zcf, Zcd and Zcb. Zce, Zcmt and Zcmp are left out of this patch since they are targeting microcontrollers/ embedded CPUs instead of application processors. Signed-off-by: Clément Léger --- arch/riscv/include/asm/hwcap.h | 4 ++++ arch/riscv/kernel/cpufeature.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 543e3ea2da0e..b7551bad341b 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -82,6 +82,10 @@ #define RISCV_ISA_EXT_ZACAS 73 #define RISCV_ISA_EXT_XANDESPMU 74 #define RISCV_ISA_EXT_ZIMOP 75 +#define RISCV_ISA_EXT_ZCA 76 +#define RISCV_ISA_EXT_ZCB 77 +#define RISCV_ISA_EXT_ZCD 78 +#define RISCV_ISA_EXT_ZCF 79 #define RISCV_ISA_EXT_XLINUXENVCFG 127 diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 115ba001f1bc..09dee071274d 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -261,6 +261,10 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zfa, RISCV_ISA_EXT_ZFA), __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH), __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN), + __RISCV_ISA_EXT_DATA(zca, RISCV_ISA_EXT_ZCA), + __RISCV_ISA_EXT_DATA(zcb, RISCV_ISA_EXT_ZCB), + __RISCV_ISA_EXT_DATA(zcd, RISCV_ISA_EXT_ZCD), + __RISCV_ISA_EXT_DATA(zcf, RISCV_ISA_EXT_ZCF), __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), __RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC),