Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2366796rdb; Mon, 12 Feb 2024 02:24:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFL4mJiYXhtEw7LqUIsvotSy4I6ghq8DoOqLrIqzRez5llR4worO970q2pz0zar0qdDDwQ/ X-Received: by 2002:a9d:76c7:0:b0:6dd:ec0f:df30 with SMTP id p7-20020a9d76c7000000b006ddec0fdf30mr6728353otl.29.1707733449662; Mon, 12 Feb 2024 02:24:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707733449; cv=pass; d=google.com; s=arc-20160816; b=foW0+Y+Hi7mVYbT2w3ph/DKpJdMgnJumP63IcIN6/pB3MrKT5yq/KRsDhydFPZZcKB i54zu+e7aofCS1FGghAcbKH7H+pi7M6rS+sj6SuhF7NEcz5XVr9LTdkTxf5Yamzh5emk xSzglERKr9TEa0u+1Br5u3Flc3vp+OkufAi3HWs9FEHmhyAVn1aZQSkQ9SAgmP4oCxmB 56L5yPRCAiGHcKMyrr0QYXVooy7+7JrlH5XXh/uLpyz1bvqxbkxO9/z6T9fZRUinYDlj 3i0z6F8Hnjk5lPzkaKTZKOOScBHDt2yeBMhGPWLZF8luWraWWlMAfN5WTADGRoxXzhcv LKfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=er7uqV/3pxqI9E15uDGZ9iWhLJcFGSi+T2B/hFaMbBg=; fh=Wht8HNj6MuKM2UAPN6fCykLTaUhebikAmEpv7J6mvGc=; b=ZgEWMhSnNcJKkiw3Gq4TnAvsC+oLtCdUwnq/5sB0gzRFl8lW2F+D4TsL8kiuYQHgPz 0AmXJsOYIRVCFhD1eqNO2FSZNvDE6j4N6pyqVGfuG99mbfuQGczNWZduVFEQqdU+tpaQ YLnxpHzWm3/bEWANbZkAaFgUUTBoPFftfKMTSqdtpSnb/zoZ+sZMldvZIX8zT9+fH/eg txvAK8f4BSyzV9kH7IEF3oZfmxNjysXdxjCwjM5dm8PP6x8xiQzJtMmCilQASjBiW2xW PWoVldnnmRFvKi9G9ygNh1F6NOGbtYIBfpxQbXVaum5eCJFQugiZ7a2FHPG+qsPjetSL PnPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=lcKaCn4O; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-61297-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61297-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUbBXiUm50RTqB9vhYshFjrHvQaQhRESaoiKId6DNRj8YpPKbNb/RYUYphtKksoDQju/43ejjC9KVvr7wb6prlNq3UUN1MQ5R4b4t8gHw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v22-20020ac85796000000b0042c7689da6dsi49154qta.606.2024.02.12.02.24.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:24:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61297-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=@ventanamicro.com header.s=google header.b=lcKaCn4O; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-61297-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61297-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 088E91C20D03 for ; Mon, 12 Feb 2024 10:24:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7361518048; Mon, 12 Feb 2024 10:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="lcKaCn4O" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 EA304179AA for ; Mon, 12 Feb 2024 10:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707733437; cv=none; b=MAeUoXsYW4pE+AKiw5TjnWpJYj8RQF7X/orgGXuQkNIyLCfRBO1pe6/IwLmRD6VoOUq6hWsC9L6tvCwH/WXI9OttuNc3hKsoVLQRrGSkmUwrs9Qag0a2NXWBMQoppbaHJYXZxJrxxe2FgVE/KU8ztvRIp+KLs7nnVcFYskmNohk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707733437; c=relaxed/simple; bh=TLWj/r7Pgt5h2SbwNEGy7ntlN2xmuVp2ucImosJuV3s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mgu4ph8f2VrGo+cBSbpzfYUu+LV0+Soh7obwKptGWc1K3E6nd/HzL77jONAg6Igsiuilm+u9egw5BzPQq9Sa3DMIJZ8d2nFZANEen21rfdLkeaS4WrRN+j5IEEPdYBhTWz9hl5n5FJ2ERYTfL57UDElyoayoP97bPP1BJM/gBXc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=lcKaCn4O; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a3be9edf370so337114066b.2 for ; Mon, 12 Feb 2024 02:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1707733434; x=1708338234; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=er7uqV/3pxqI9E15uDGZ9iWhLJcFGSi+T2B/hFaMbBg=; b=lcKaCn4O8jWvmQj4JVY2b3Hu8aDVbmgdz2MSKl3Gjad+fU4f4dik8oxq9eDiS+drGl IjnyN318J4XOb1A1odLv62vyT/9YQR+VKcjQf+iI5YfGKGVq5MN02f5JMRnUVROj+ci+ bgN6ua1ifcd/6Xn2Cq3+expZKP7zP+BLuY3vmbwELmnICmFKL/TIImS6Y1Hxv7f/z8Xm ogdt9pzj4EtkGrvtpwPOUXbxRPoezbAyZUlCuRGBfevvUbQZ4SGChvBUsrPg+3HsQK0a R9Wo59Amv+y1NlFIeZZZHE9ocdY6qyuHG9QFjEZGS1YHvVA9YuCliQYtyVExkaKTnP0I JU0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707733434; x=1708338234; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=er7uqV/3pxqI9E15uDGZ9iWhLJcFGSi+T2B/hFaMbBg=; b=kLovHkEIQneZ+1lAn4BXnV2owBV/jBLgWxQvUsME5iSeSuL06bCvVhKxS7yblsgRM6 Z3TkJlQbRgOyVDH8+ZXJ5TVmDq8bn5p5W1gkiIDXZ/TSNWaPqRIGMITO2Tf3t35JiSUl nANQq3Aw6CHv7EO799Gdgr6su6leaLCcuwKEceo7qdtAGVr4AJ4GGjOxAJxM+HZiVu9s GeYcFcKjlFPVsCqfafcyLJKZBHIgHXPe8NqO9M1ezl+wBL/Sf5DkvAIZFoy+gpV5FLlM cSqNLENvRdicyV0onMgTPVhka6if2de8Q1lkW7RhaTLH42wsnz4PQecYlJOlT3NLUjJn m0Zg== X-Gm-Message-State: AOJu0YzoFENoxYwF1iemi4XTEZI8lFHpVdTSZq5eV5GMAZMBrOy4DfS6 IAlBoqDnUVzBwGOvZ1OomNKeNBVKKmFZZbzGxFcAzRTHUS/iclFebJpX9rMxJMU= X-Received: by 2002:a17:906:a88b:b0:a3c:cebc:9e0e with SMTP id ha11-20020a170906a88b00b00a3ccebc9e0emr567479ejb.66.1707733433939; Mon, 12 Feb 2024 02:23:53 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUPAzE+xdeF9TrZSKLD2pHEr88oRydbkgxmrvinHSvSQxUcUIyGSd4eufO2JDcBJ7dp7k0omkE0TZm5KqaV2RSmopwEH9KJUBeAuNEnCQZp/Na3kZyhqGhtsPoWUFMQWLjH8g1/XK5jmvnK3onAoGGYAjWJYmG20MsKxc8Yn9hXfF2DIBZZzGU6LHBehpCvPsVjofyX2DVddSWuIv/g8ypG3DrQoeVz4cIaOtpF0w2aQFPxniQSHtJKifQoI36QcqUz+GTeRa25cUcHcaFSIQmeIhQc0JSMEzlS4c0IEEQuh4BCexsaE+Q2RkgtWWZhpOa/zFS9tiBq7NOlJoD7GObmq5y2nTJbzou3e8N/JqJSg+NdzdwTTJUpVKPs29VIz44lxo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LRKF0FHpPoBy/q+YQhTYHMl18uxLehORfxoVvopoQWyWBYfdFhJ6Zw4rz8Q3MZWMxMDQ3CncpPaKx2ctow9uTjN8qQgbOhE/nRr55TRTZYeL2J9umD0EbRUOAPfKrtRYeRcln+faWGY1RFXS0SkOu8ul3zt4sehJkmrrwdGMZP7KTM7JcjoVtmgaa5ny3FdpkRXFN6TbIN0bGzTgwdO8Q47IPyS1xFnDgY3d3inqjDrNKZ+ApxxPH0VXmkBGBMUz3yomR0ChsvRgC5CMHBStwF4uSxPqonHfDFzPjINLbSkuK5J1iq1mGTAGg/z4AFlUd/6W2ARQswjf42gEBah0qBZ/jxD0NzH+A1BvfORnnJDXSaxlJzogY3Yqw7ulEjTbff7wBfEAQd1+H23TSbMHcfcEg8bJq1L8w8lzRqmE3x5zY1gHR9uI3y8tKtTr166Quq7EosM5SUUfT9LoO3vcs6beCXmhNk7 vesJ1Ft9sE1alaQEh Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id cd6-20020a170906b34600b00a34c07816e3sm61419ejb.73.2024.02.12.02.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:23:53 -0800 (PST) Date: Mon, 12 Feb 2024 11:23:52 +0100 From: Andrew Jones To: debug@rivosinc.com Cc: rick.p.edgecombe@intel.com, broonie@kernel.org, Szabolcs.Nagy@arm.com, kito.cheng@sifive.com, keescook@chromium.org, paul.walmsley@sifive.com, palmer@dabbelt.com, conor.dooley@microchip.com, cleger@rivosinc.com, atishp@atishpatra.org, alex@ghiti.fr, bjorn@rivosinc.com, alexghiti@rivosinc.com, corbet@lwn.net, aou@eecs.berkeley.edu, oleg@redhat.com, akpm@linux-foundation.org, arnd@arndb.de, ebiederm@xmission.com, shuah@kernel.org, brauner@kernel.org, guoren@kernel.org, samitolvanen@google.com, evan@rivosinc.com, xiao.w.wang@intel.com, apatel@ventanamicro.com, mchitale@ventanamicro.com, waylingii@gmail.com, greentime.hu@sifive.com, heiko@sntech.de, jszhang@kernel.org, shikemeng@huaweicloud.com, david@redhat.com, charlie@rivosinc.com, panqinglin2020@iscas.ac.cn, willy@infradead.org, vincent.chen@sifive.com, andy.chiu@sifive.com, gerg@kernel.org, jeeheng.sia@starfivetech.com, mason.huo@starfivetech.com, ancientmodern4@gmail.com, mathis.salmen@matsal.de, cuiyunhui@bytedance.com, bhe@redhat.com, chenjiahao16@huawei.com, ruscur@russell.cc, bgray@linux.ibm.com, alx@kernel.org, baruch@tkos.co.il, zhangqing@loongson.cn, catalin.marinas@arm.com, revest@chromium.org, josh@joshtriplett.org, joey.gouly@arm.com, shr@devkernel.io, omosnace@redhat.com, ojeda@kernel.org, jhubbard@nvidia.com, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH v1 01/28] riscv: abstract envcfg CSR Message-ID: <20240212-cf2c44241bfd5e942a4e3752@orel> References: <20240125062739.1339782-1-debug@rivosinc.com> <20240125062739.1339782-2-debug@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=us-ascii Content-Disposition: inline In-Reply-To: <20240125062739.1339782-2-debug@rivosinc.com> On Wed, Jan 24, 2024 at 10:21:26PM -0800, debug@rivosinc.com wrote: > From: Deepak Gupta > > This patch abstracts envcfg CSR in kernel (as is done for other homonyn > CSRs). CSR_ENVCFG is used as alias for CSR_SENVCFG or CSR_MENVCFG depending > on how kernel is compiled. > > Additionally it changes CBZE enabling to start using CSR_ENVCFG instead of > CSR_SENVCFG. > > Signed-off-by: Deepak Gupta > --- > arch/riscv/include/asm/csr.h | 2 ++ > arch/riscv/kernel/cpufeature.c | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h > index 306a19a5509c..b3400517b0a9 100644 > --- a/arch/riscv/include/asm/csr.h > +++ b/arch/riscv/include/asm/csr.h > @@ -415,6 +415,7 @@ > # define CSR_STATUS CSR_MSTATUS > # define CSR_IE CSR_MIE > # define CSR_TVEC CSR_MTVEC > +# define CSR_ENVCFG CSR_MENVCFG > # define CSR_SCRATCH CSR_MSCRATCH > # define CSR_EPC CSR_MEPC > # define CSR_CAUSE CSR_MCAUSE > @@ -439,6 +440,7 @@ > # define CSR_STATUS CSR_SSTATUS > # define CSR_IE CSR_SIE > # define CSR_TVEC CSR_STVEC > +# define CSR_ENVCFG CSR_SENVCFG > # define CSR_SCRATCH CSR_SSCRATCH > # define CSR_EPC CSR_SEPC > # define CSR_CAUSE CSR_SCAUSE > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index b3785ffc1570..98623393fd1f 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -725,7 +725,7 @@ arch_initcall(check_unaligned_access_all_cpus); > void riscv_user_isa_enable(void) > { > if (riscv_cpu_has_extension_unlikely(smp_processor_id(), RISCV_ISA_EXT_ZICBOZ)) > - csr_set(CSR_SENVCFG, ENVCFG_CBZE); > + csr_set(CSR_ENVCFG, ENVCFG_CBZE); > } > > #ifdef CONFIG_RISCV_ALTERNATIVE > -- > 2.43.0 > Reviewed-by: Andrew Jones