Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1280401lqb; Thu, 18 Apr 2024 05:45:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZl69fJeVghc3teb4J7tbdnbHMTnzjEuFwyJY1xm0pzIazEG/PxVR5FA1vh7iKrN43qB3XJg5RHmjvlReJIkiDqPHl3FoJTD1hHKgOtg== X-Google-Smtp-Source: AGHT+IHVjloUdbKDxh9HFa1u/N1m1SpBGLCUKFGw/CqXC2vRbLBw84lpz81BxamOQaivgrYrtn8h X-Received: by 2002:a19:a41a:0:b0:518:e06c:3358 with SMTP id q26-20020a19a41a000000b00518e06c3358mr1860501lfc.14.1713444304058; Thu, 18 Apr 2024 05:45:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713444304; cv=pass; d=google.com; s=arc-20160816; b=C3tmdj6iSCc0vPkp/PcLU+qJTD3Ka5aNHcTncyZXHF/UJ0cnzfXVkdxcD6tj2YeC2W JU9KUfQsVlQkaUftlHygjQLGgnf5vfvCWC0ZXTtYeyUHtpP1JU6t0cn2HuCBEpSbsc0Z vrv7vp11N9Wx/3nFtvVjS394aJ7lW/hSafXO79LNYJA/WPToJoib6e38ciOFbzM6uHEs 9VBLUPjKKqs8MxKAH6ANSmbaNyOk7G9oiXHZpIMaqT3tMQfYI7vMVHFzDdiOHBmsoZjD hlQKm4G0Z0SuI5hQCmheixU1gc0uwYGP+kMTnbsX2ZEMJ0hxfSfj/LRZNo3ZVVYmw/nU XaeA== 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=Oul/88VNSbotq4qqoPvgpqzTp2eFHE45oRFKT7UIEko=; b=k+5R7vtSsumvywzXfUkuWs/YP9IQcnJZWiJceCf8tIkp6pu8OYtC4aipUMOVOfRaKt MwYSgjqeokrRstLEbmLSWa7vn4yEWBfF2Z7owGQy1uxY/7AgPsnzLLO8fAsepXp0abKZ C1AIaYGN342yjXXw0RHadbaPWymLL8IrS+qcqLT7q8sQE2JhTUTohUi0OaqzaOxlxd0V 8q4/cn9F4Ilr1gzxihgau5KB0SeAKQlTkPjNnO2lynKdA1nJ2v8iU3qVPOwIZEoFbHDQ GDz1RmtzusFMGcRNnXlVeSGAaeM751HoTr8RcVZGQ9HeEIWNfLs27CLp4xkH+ctxaMya V6ww==; 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=F0vGwcL6; 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-150080-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150080-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q15-20020a50cc8f000000b0056c2909f23esi817027edi.149.2024.04.18.05.45.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150080-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=F0vGwcL6; 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-150080-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150080-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 BED251F21C55 for ; Thu, 18 Apr 2024 12:45:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E91C16130C; Thu, 18 Apr 2024 12:44:03 +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="F0vGwcL6" Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 6B27915FD13 for ; Thu, 18 Apr 2024 12:44:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713444242; cv=none; b=uGRYgf2IT8T2L8BtOFX8uT5tkpOGi9mV/XAlos1fYy91gbL2nveZ9NzodEMpFAKzYKejCfgZtCWrlHvai+X4w0vYVWJR/lG9ndngJhBArFQAFdjnr65oeLwP4emgoerku/jtwwhQiD/N+JhvKfAoF0HxSht9kMVtsMIcE8uiOFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713444242; c=relaxed/simple; bh=SrpAxjIaY3RV8BXenxbFlBJKJmsCS8qPO2iasFfYMfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Vpcqibvz7E4YIm2LSop5opj8gSOAl1s9OPRrYAgshKQzEAcJUKv1J+TKVSQW/g1WhSvbeN+AlblJDohwa4LA+7wWRvGMaOKBTsFCJg3s1bsbbxR9ubo9mSNpynmPwd/gG+EWGlme4IDyM0B51s20hlV1ws7IPWbMQdNvdrXxzb0= 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=F0vGwcL6; arc=none smtp.client-ip=209.85.221.54 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-f54.google.com with SMTP id ffacd0b85a97d-34a0cc29757so75304f8f.1 for ; Thu, 18 Apr 2024 05:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713444239; x=1714049039; 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=F0vGwcL6w3PptZ6deCyKLtJ9QDT+nQmUG1cZnZJrU+mgbKRzgJSpnwGP+40BhVL3h0 S0ncc8TRLr0qWrR4f2R6xIB6x62GeDnzSsOBUGCjtIDv700LNORnFz6MuIZBhlEbPR6G OA9YKwQQrX9ClTRxh50P9AhSBIw+HLEcW1+UHU2xCuKAPZpZivgrmoG1gtMI1kruOeo4 eZ3KWIcBIfM2SdXTEXipBQ1n1k2gCiArxQO1cyXnCbWSs/if6iWVvQPOpNtGTtaGOvTR yUWaEV9J4A/0Iu1LiRpU1OkEPwcrYM+lZAUHTC3GQ1GC0urxOk7kMzMPCqsz5FJ1xXH+ VZ5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713444239; x=1714049039; 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=Bpui3XZkFTSNWSMFX6gPe0k2CPBelh7pGWRggPhi2m89I/XMI/QSO9H/eRrdSeAVnU N9C6fHqlDJ7Wc6VGa2cm689ePyKx6X2nBwxr3OUj4RXVNDnh8XNuVzM56Ti9ietZz5Hq lq3yOoNXmm9KcjX9r3EgnGPVbsBnzIzwq4248vTbvm4EdqoCGaJOd2Y1tAfRPsdQVfjK 9DB4FmbntRiYmxgK2H2Ryn0cDBnH0rV35mgwKJ9XqWg0d4r7N0FRdV1ikhwC5pLfY844 HSMYjz/kFOS4sZmr95nycpyc0nZI0i20gWdTB1LbZ6yppKnqcCURddb25cBGSmr5GGX+ DOOA== X-Forwarded-Encrypted: i=1; AJvYcCXo1Tx1eZRciC3NSf1yrCGUWQ439zwBd0GOPMetw29O/JlvQ7XLwJgrXJPHakkiTRZN5Eb8/tQyktcGD4qWNTbynDYxB5m6EqvKh7hE X-Gm-Message-State: AOJu0YxRcoCSfvGhR87F49QA3uVaCi2KDQueEZep0v9lZJ6yl6LWP8Is 0Tv4IUGwQpwirWg1BTcrGtnY2DVwYG6cQWwqs5jbpKyf5HMlbc2ege74mDJh3kA= X-Received: by 2002:adf:f60c:0:b0:343:3f59:c97e with SMTP id t12-20020adff60c000000b003433f59c97emr1553063wrp.6.1713444238851; Thu, 18 Apr 2024 05:43:58 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:7b64:4d1d:16d8:e38b]) by smtp.gmail.com with ESMTPSA id bi18-20020a05600c3d9200b00418d5b16fa2sm3373412wmb.30.2024.04.18.05.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 05:43:57 -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 v2 04/12] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb Date: Thu, 18 Apr 2024 14:42:27 +0200 Message-ID: <20240418124300.1387978-5-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240418124300.1387978-1-cleger@rivosinc.com> References: <20240418124300.1387978-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