Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1442468rdb; Fri, 16 Feb 2024 16:59:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfR1FUvHSipsh4ylCLTXUtTxhhJLWlqirMzwjO1T3OQREvnGRNRXkYP2qlu7MMRthWrLzTncQKrw+CdV2lFvrJ5r6IxRTkPw/GshwQvQ== X-Google-Smtp-Source: AGHT+IEtmS96PVm69S0TAjQpNeqZxJuT6XD0QeqUNWbbHe0iYlt743dcy4y+cVHTl47YI1uIRk91 X-Received: by 2002:a05:6830:6b88:b0:6e4:288e:4a1f with SMTP id dd8-20020a0568306b8800b006e4288e4a1fmr6349350otb.25.1708131570157; Fri, 16 Feb 2024 16:59:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708131570; cv=pass; d=google.com; s=arc-20160816; b=wTk3Yv87PHDQ9SctjeVx4Dc3M0OheS02vC6llZe2+CSHbERpdcmacjR7A7N7lHCBM8 R1aNXL2GlYS5MGd+eAFeAbYYvFCMXf/kMtc0A5n2GYAB0b+KkuAEjanH2x6TxdY+t694 G4y0CRO7tX+Mp6ptVvDnPu4ma8LFySvJ9XFjSel/LwlWhKgz92rpTYw3CamEwYoVmHIu OSdatM8dndAVaTGleEJCb73NvKR6QVrzC933PFbJFqI+Xf8DM0SA6fm/VQzQBVIOQ2hp T0QdEaw/eG2Xc+KNXtfPj8Gr8xsOczKw90mOMILMVpqr/lJVRv+g9ATlVU+43mNYl7Ys 44FQ== 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=fMgr1ik/uEkkoRNgvQCIWXGmAGeZi75wQYv7ioKJulE=; fh=VCn6lt55QOKjzv0Hbz5VO3vbW0BxeXx0oGBGk4MoX4I=; b=OphHDQZY/TLPqeDsVCQPB7ShMyTXgpjfJBV72u3aylfZ9chp4WIDYgjgYWev9TGXsP TS4RYLeCJ0tG7YLZb5cTvmSUFeGuLCWYjwXv7lierZvXfovBZUfPXKa5iVpW/qs6bYqY ysA8tcyVlsIW10hrTrdvoPMieo8LNEvz1Lv+XE+JccixASUFWE400ZDwzD6//GHlg3Vw JJ+QDtEZOQFcsBFira/ijYvgBplkSYjOPwN2jWcopTtxjZ/xyNT0dlmqbnuNGnTMkzM1 4kIldedQEcZxT1VxFnC9DEY9AhQmqFlu4a58IPoVV6kbrWFDRpsKMPaBrXOt+8Doz5jL aDcQ==; 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=R5vvGFEZ; 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-69594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69594-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fh26-20020a056a00391a00b006e0945e03fasi721870pfb.162.2024.02.16.16.59.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:59:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=R5vvGFEZ; 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-69594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69594-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CF956282811 for ; Sat, 17 Feb 2024 00:59:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1695D1CD1F; Sat, 17 Feb 2024 00:58:26 +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="R5vvGFEZ" Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.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 654F31C6A8 for ; Sat, 17 Feb 2024 00:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708131504; cv=none; b=u5nfVIYXNi+tx1DUj8V/A5fgCBIxTDJoh6roCMj0NgY4aF6t5aBpydPMkRf1FpNmUhxHXi8I8rsqnF+8IYMGPM/JZptVQMGfLAkhWr2pW98sPjbgEIMnXyaM3xgs8IRfzip79f5doU9d0RdzeS7mlXmMPq+lY+juOna3/L9SryU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708131504; c=relaxed/simple; bh=FCKxku0LcQE3xpAfyxEfS6d2yCAYIXFI12M5ylW0v1I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rhk6GfRMosJJd2Y9dOfwH/kGnL/Wp2kKNDln7TfWw55PsqxzRLaaOF/EJDSU6Ql6VgBhb4uff30hSYv1Kq/qwth4Bn0wBi4swvEgkKolig1mmwmEuLedDOCAf1Gxltbk8eSRZeBzgUITYV+H1v4ZDXfDAA6n5bq+eIanal7icdY= 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=R5vvGFEZ; arc=none smtp.client-ip=209.85.160.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-oa1-f54.google.com with SMTP id 586e51a60fabf-21e2673a206so1708372fac.2 for ; Fri, 16 Feb 2024 16:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1708131501; x=1708736301; 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=fMgr1ik/uEkkoRNgvQCIWXGmAGeZi75wQYv7ioKJulE=; b=R5vvGFEZ2iZxmGgUBjEmX9Bby79SR1/fvxxIQNnda+5w38QKh9DG4o5/Y7quaUWowM Hf0InKwSKImTAHsMAh5QehKJCHOZ6L0BRxzhVXyp1DYBoi5aMsZHQJlUB5eKWPL7Ds4j WZXPsGNlTkmdBl378/6z6NpLeF4T6tMZ1TOshZHDjMfqBd++j9+8ujL9KdQDez8BY01P 12MmxgQeuJRxoopPOKRpumr17um5MmddTKjwPDBewS5HsD6OoNKx0VcnnLxqlwl6CUZc iOwM09cDvv188DZ0kiYw5AAAP+d7EuDkZaJpjPj+BCszhcG3QXddvqZ9SIJfVgrtoOeM ollw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708131501; x=1708736301; 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=fMgr1ik/uEkkoRNgvQCIWXGmAGeZi75wQYv7ioKJulE=; b=Jby9w/M4kHyHU3FboVFW19dl95dzbmMG4cACgWTeeyajG//RjHaT0cQVQKZSVwgS46 hnOLmUfSQKlWx7lETIUuYQ1oGR8sKupAFw5y6aXaYQgocNQ30Q4xMtCmmd8ZZ6E2MQuh DyRumLO3uPBBl2eKYWPqLv5oOuUcxmxWRNKjgLNikIfyisAcC7ycV45M7dQ4N583lGsx SOCS6jeBEZv/Cphu9ZHKz2EmoRVATNILaJJDfu7IyW4U3wkNCkMyStX+MIfNbYAOIFAq sFwYwapOxvMeFlzjKiwhJHEk/P1b4j+ngAmTEbo2n/XOi9Dp0bSnHRz8DwwzjsrI47wq 3jag== X-Gm-Message-State: AOJu0Yxgx4fHlYZmmYkOZWhQlENx6m9Rka4/lnRiNXfI/nAH3hhfPzzy Q4sr4VH7ALzUcULnby5OJMD6l+cZrv3eECV/Hk87iS0VdhD8fuU3xykYi+YCXEJO7Kc4KJoHi42 h X-Received: by 2002:a05:6870:224d:b0:218:d374:9b7b with SMTP id j13-20020a056870224d00b00218d3749b7bmr7867438oaf.38.1708131501652; Fri, 16 Feb 2024 16:58:21 -0800 (PST) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d188-20020a6336c5000000b005dc89957e06sm487655pga.71.2024.02.16.16.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:58:21 -0800 (PST) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Adrian Hunter , Alexander Shishkin , Alexandre Ghiti , Andrew Jones , Anup Patel , Arnaldo Carvalho de Melo , Atish Patra , Christian Brauner , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Conor Dooley , devicetree@vger.kernel.org, Evan Green , Guo Ren , Heiko Stuebner , Ian Rogers , Ingo Molnar , James Clark , Jing Zhang , Jiri Olsa , Ji Sheng Teoh , John Garry , Jonathan Corbet , Kan Liang , Krzysztof Kozlowski , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, Ley Foon Tan , linux-doc@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Namhyung Kim , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rob Herring , Samuel Holland , Weilin Wang , Will Deacon , kaiwenxue1@gmail.com, Yang Jihong Subject: [PATCH RFC 03/20] RISC-V: Add Sxcsrind ISA extension definition and parsing Date: Fri, 16 Feb 2024 16:57:21 -0800 Message-Id: <20240217005738.3744121-4-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240217005738.3744121-1-atishp@rivosinc.com> References: <20240217005738.3744121-1-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The S[m|s]csrind extension extends the indirect CSR access mechanism defined in Smaia/Ssaia extensions. This patch just enables the definition and parsing. Signed-off-by: Atish Patra --- arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpufeature.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index 5340f818746b..44df259cc815 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -80,6 +80,8 @@ #define RISCV_ISA_EXT_ZFA 71 #define RISCV_ISA_EXT_ZTSO 72 #define RISCV_ISA_EXT_ZACAS 73 +#define RISCV_ISA_EXT_SSCSRIND 74 +#define RISCV_ISA_EXT_SMCSRIND 75 #define RISCV_ISA_EXT_MAX 128 #define RISCV_ISA_EXT_INVALID U32_MAX diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 89920f84d0a3..52ec88dfb004 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -301,7 +301,9 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { __RISCV_ISA_EXT_DATA(zvkt, RISCV_ISA_EXT_ZVKT), __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN), + __RISCV_ISA_EXT_DATA(smcsrind, RISCV_ISA_EXT_SMCSRIND), __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), + __RISCV_ISA_EXT_DATA(sscsrind, RISCV_ISA_EXT_SSCSRIND), __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), -- 2.34.1