Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp17363lqj; Wed, 10 Apr 2024 02:23:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKTODp6u1PsvGOdJwH44HdnAEv/Hd9OARPxmOReHWQOpcA8HjJjci2ktq5DPBLgSapAVZSRQx4pA+ogPXUOzqebiWcEKeLL6FeCp77Ww== X-Google-Smtp-Source: AGHT+IGrvCJo+8NXT0Aqusehk9GSAqIOfwPyUGEPwlmtM8JdAikSdbZoaIm+IimmJTTLx8lnC9IW X-Received: by 2002:a17:907:944f:b0:a4a:3441:2e2a with SMTP id dl15-20020a170907944f00b00a4a34412e2amr2047114ejc.55.1712741001555; Wed, 10 Apr 2024 02:23:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712741001; cv=pass; d=google.com; s=arc-20160816; b=pX/3fVr4DEbs2+W34U1sxqJAY+7NBgRoPqKFX2DAZX18U6kichndnSz5bOqqlYxHd7 u+psYgL7Yw/LwriqksIAGcbet5AW/OhnUGjXr5aUax9bFrqX1Y9gujdHPNkDstrVU3S7 1kKL3z5IEqlEetcI3bsBFu2h+2D708CH1WlYe4GVmMoo42Rfy8mJ1cwui7qm/qn38TCY ZIzn+ww4HJORlLmEKqKYwGE4puZBlqFPh+ZK93V9IE4U0aEWjGg1lh3pWPRgL+Ev1VWg QzPMfiOAUtTBVcOaJZFXgEuviycsSEtGVZ1yXfV64ZPeOt1parR2C0lsanU+GRMiZlE7 C9AA== 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=hAM+PbC/Wqgx6Q9RB0x39wuP2KdW0QgVrrLDnXaQ5i0=; fh=WQUHEvKiXLgzo5XJqHLlsm3KKsio0vk8wD4OMoW1RUk=; b=Y73dZMkT8CvaCUyCcueUAf4yk7kULBSsPaWI0WrIPMfj6hG3t1umMkS4pC9Ups1u+X 7z0wIOhW5zxhrvad6j7sCf4wCVtU1gkemtd2JDIZAaH6WGULAjUSvFe0QVLm3h9CD7Yu RBvWsAnWnIFgTJVLYq7kMcN/dCWnfmKMJzX/PjySTJXboRSyfkMWC/MVix752stLf78m AXDoV+uO3cwkwL3bFlp3FLkoy4wtjC3QdSW/rZsbGQ8vetWbOrtTDGzUzNVAUhZhfrRs 5FTuBO6lwrOZ3yVNEpbow3XmUj8Nqf5sB6fFzdMx2qcUUqMVeDxjQ3M8D4owfw1ArOUt NC+g==; 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=1ddCqqqs; 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-138227-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138227-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 p23-20020a17090653d700b00a462c4842bbsi5951557ejo.676.2024.04.10.02.23.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 02:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138227-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=1ddCqqqs; 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-138227-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138227-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 BE2A51F23F1F for ; Wed, 10 Apr 2024 09:14:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71FA715B15C; Wed, 10 Apr 2024 09:11:18 +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="1ddCqqqs" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 BF24F15ADAB for ; Wed, 10 Apr 2024 09:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712740277; cv=none; b=lXGgFN9Mw3sFZqCuhq6Exw3uBntIQFH4pVa0mytF5lbmyGmQ1tkaaTRFbhW7pr4UH1NmKyDEgm37/j20DrYfnbVC3UvE9YLUfSozRMLWBqxb+8IjuE6mOJfUKKXF8J7eQJpeU6JSMTnrt2hkiZ8+Q2353W1PWeE7T4xkiXfiMB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712740277; c=relaxed/simple; bh=SrpAxjIaY3RV8BXenxbFlBJKJmsCS8qPO2iasFfYMfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i7/71HXTqD1kq3gP6Mn06+6B1ttauyiHEbQ1eXw1UIsiDKnKGmCx/u2WtLI59xFOIfa6yAuB12wJPU+S7Atl/zLYBBXPU756LDu12RSitU5/GLWCc7q7tXYHTHgKIblA6l3pyGEyMysM6YZetp/hGdFle27Q9cQiOUmr56nsw1Q= 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=1ddCqqqs; arc=none smtp.client-ip=209.85.221.51 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-f51.google.com with SMTP id ffacd0b85a97d-346407b8c9aso516550f8f.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=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=hAM+PbC/Wqgx6Q9RB0x39wuP2KdW0QgVrrLDnXaQ5i0=; b=1ddCqqqsqcyQBdirnIFdkGzDqgMdLMpzK9qORXE5ZHQxUi72RPw5KWci5jx/Afd0sD 8FxEMw4UE7rQiSzfGyf4QIc0rCCCpkA/UwvFIdbc8oU4Bur1ntn5EBpFyQHeFdkX+SIX anHvRPlvpoouubtRlRhOqrvHfXjWnhcnnh3zW2sgm3mM+Erm4erjdXkNut/8heN7S6wv afSFbpXt5owL4qLNE/cWu/r74yAv57hzntRGE+iiUcC4oBBzWg3r+Qg0KiWgcbkSwIzz WRwqIxAyc9XJ2EjAJ/CKwI1ksPK7eo2JoEiDfYLNavKDYxeugC7+pGTrISxt31GdsPbs L5AQ== 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=PWqUAIm67ntnTusQVSoOgeTMU0QmWbNJLmUcqu0RW2M+YkTK1hRdWrmr7M2XDXW3yA Cq7bO6e819FY41/9dDwSjsZob+y0yesKBBV+5U3YElGiU8Jma7zC9Nit/q1G24EZO7vf WO389lkwFKNI+AhzfdWyIgrg/kfy/Y/06PCMUy5noDIwKVBdORyP8cWPUKHUIgaK6xlh NnKqq55ZVunkksHLsTlY3NOjSg6TjolaeqSVuq3DRcRWC5dHzQhttUDgzp/p+FHPOflz Kt5JxJGW7Se+1/tREZ54xe50UyVafh8rnwMq0SKHK/XJEqlGgPTakCNCdAOKKTtzkLR9 KLGA== X-Forwarded-Encrypted: i=1; AJvYcCW6aE2CmgN/SXSv33Yx4kvhNCleDAMILkB2K0XDPV75ibQ2j6T+pGhWveY38vOM6XitECwxSzot5XOcTn+8MX60zhvtyHt0FwiP8GZc X-Gm-Message-State: AOJu0Yx34kvDEEfLi6hp5ume2xYtPcV6AHjKf26CfAOTC+ZutYuBzwX5 Xnf5uEQCrw/r0X8v1G6TmTbzH89uNORZQE7u/nY/CCQed6wPRK+vTOx5okCVynU= 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?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 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> 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 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), -- 2.43.0