Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2366176rdb; Mon, 12 Feb 2024 02:22:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXS9mRKcTkYnXal7Tmd66/iBHPCAdu+YVUAvnxkjqSouRjDIEf+y7XtqwwSDpIgx7rQJlvYN9T+x627hdwlBeTRNl5WIdQXqCM7OQedJw== X-Google-Smtp-Source: AGHT+IGuVLGnThpaqXupfnqYz4tZTMmcAQGjIybe6PyAaq4oTGIfL8DoSJCFfl0k/JG3IagGVchd X-Received: by 2002:a0d:f744:0:b0:5ff:81fa:16e6 with SMTP id h65-20020a0df744000000b005ff81fa16e6mr5801542ywf.38.1707733351831; Mon, 12 Feb 2024 02:22:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707733351; cv=pass; d=google.com; s=arc-20160816; b=oJkPCb/mi2zUKskl7PbLvZWXWTQvqJJsORWO1L9Ce+WezDXTdwfQiksJL2R0ZVqCyh m3rXzrMW1u4ivPLqsDti8cK/3lQu0nybTbmOV/sYqCnCWn4oY9CXtMgCJlNwsaq8nl6g uIE2eLm4o/xDTPJENN9wD0iQR3f8MBdXi9vfTRcCL5a6q6IxK37ETMehvBX+421sn1Lg GcfM3DR0oJ7P2cQYeqFCxApxRpiYmee0nDcwBneR2zlaWFuYv78Wilax35/SFl0IhDsB SlKxcWuOBTmeIOIUA67znV4RJS8em0cZEkpBS50dOeGDPZYzhmqMXDv3R+KO6CxoMRgm gLUA== 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=8QF+Yu8kjYSyF8+VL530MkO85lQO3uEFBWUk3k+lqh0=; fh=a2vM+UQ36AMarbY+zVUoRCObGsza4AHPgoR57HVyvd4=; b=CNbUZLjN+bdRYSCm+t3+O5fSEyYyLkQ5rEyQ+b0kEAbgmEroo67YjUwd0qw68rXgxn erDVC6qtszEq+4VZ7+MALW1xjQYfdLsp3ucxVlTu3SagCya3NHdu31WSLdBvF970xYM7 EkjwPx30AFToQI13C6jhZygbgRAiVu4XmEjL8k0Ug4c0rvcABr/wVND8FNNNtXaJl9qQ v6sIC/ooDEGdCQ/haQSfvI8T72EzFbQrXzSWWuEvq811TTEep0+WEzAZxgMI6KQx+nCp J4JQe/bwsBsqmG8YkELslkMZthD8LJVOfayUhQHKdLl71ex/anhPiQAMWHhqFBBGCr9q e3IA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=EfPk0P43; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-61295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61295-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXWbjLnBL0qB+5Cmv7Pb+/0cees4TKfHcz8Fxnz8tY46PAqTFtS2qrx3OV4+LALd4WqQKuP0RAWw3h8Ym22we4dZpBYapmpb7Er7Th31A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s8-20020a05620a080800b00785ca4a86bfsi4538545qks.459.2024.02.12.02.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=EfPk0P43; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-61295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61295-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 4E0D11C20AF3 for ; Mon, 12 Feb 2024 10:22:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F73C18030; Mon, 12 Feb 2024 10:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="EfPk0P43" Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.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 D997512B70 for ; Mon, 12 Feb 2024 10:22:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707733343; cv=none; b=c4ZMK5y3ufa7bgi0oDl23FYq9qSczDM2WXw0tLTzgZK2wtsPHoMp/sGNQmDp56HaPSTuHOX+Z4DNJ2rNcFnPjb7rH5Qxta5aGHrm8UsVHXRlqpTwK/C5+2vKlyrkOPJEfnbuncUPxgDHoL/oh60rCvaNY0venhQAxA0K55vwPno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707733343; c=relaxed/simple; bh=p2AuQvUBimzZT49rpUVISG7UGfVB1BHw9Gqh/gjFlS4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ogMvzBbfgSagljogYWtV/YEnH12sJ62OG95Beo4ENY4orjgF/vZdPRPXLYpR5nAJ4RD9DTTISnrJeD/J6k9LQLCJx3TNMH5M5nzY/M4cDjkjDeMJ4H/WmSfafoYojDuTEMz5s+rYCg1eV0ozYmHUwUj4B4vO8UsJcAA8IYMJdvc= 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=EfPk0P43; arc=none smtp.client-ip=209.85.208.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-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-560c696ccffso6969918a12.1 for ; Mon, 12 Feb 2024 02:22:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1707733340; x=1708338140; 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=8QF+Yu8kjYSyF8+VL530MkO85lQO3uEFBWUk3k+lqh0=; b=EfPk0P43tQDXTRArVPSdLMn/rBb9HNo4V5tGdMlQXL7Sbojec+EuwOfIODS4tJWELL ftMR4Zf9Pra6UfBRZn0k8N5myKvX2bENV3FuVFAgc4V9G2Dwkuk4iCe4UhHAabNHI3t3 z30HUiNjjkhzpQ1sChQz+xGOHXZiWZhzBpO/V3gDTWMGhuPGeF884/2kFF8qEmpzw4yx X6e6ebPq9msAZeBkQogdrvL5UmXi9YqUTyosp3B2I1twgHzi+NgfZSp7IvoWjQOLysI2 1F+xnKUWXMwtamzLUyB6Kto/+DrtocJx7dtqTYFk2VMRgOjiSFy3kPbciId7Nmjfnxnf +qBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707733340; x=1708338140; 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=8QF+Yu8kjYSyF8+VL530MkO85lQO3uEFBWUk3k+lqh0=; b=IJmQV/8322/7ER1C/1Ma8o2cigOwU7RGG2C1pLIcTqF1/4NfALBM4KHUoM+PnIEqxE MOSlHMcJir1LLc7+H0CXy5YxFdr6rcavTxkYr57XzcQL56/OfukDd55DMZrmcDr3TX1K fsCI8SxN5aW0PSKZo0YI1Yi2+Xgb4Kpc2noPB6usYbz3LUNoowl88jm8DGyYzK5hi0/7 3Y77jL7KiNO5/U6aqJ+tMO8BMSch3XH8GeBq+hMwojXKrkSL1C76jPurmmpmXyen9B7R whyDbzsP53BIWXU3nYVKv1XpvdI6qvcyLI/tkqB+6bHp5lK6bySoykH8IdF+LoN1RJRj DH2g== X-Forwarded-Encrypted: i=1; AJvYcCVSQz8SOlLGnnisnxNdg4XPMBp3w7QlAoVW8FemaGJ9Pe2SfkvJrFPPin4VPfswiErXxGF7zVKE5ju4c5wJMA//faPTTnBdIm51EBU9 X-Gm-Message-State: AOJu0YwrNN0u/si/GuXAhU6mX3QcvajxSYwLw11Mx//TZpVovtLp4p9Z Szlq1yZ9MroQGk/y+4fthEiI9l73A1tk8XwRJisJkoKhYCRdaqC/1CqnslsIfNB+uHD2xRd454d o X-Received: by 2002:a05:6402:1618:b0:561:58d0:b222 with SMTP id f24-20020a056402161800b0056158d0b222mr5716785edv.21.1707733340173; Mon, 12 Feb 2024 02:22:20 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWW7EbTEIN+YaUjxiU/Tj3RdOcwHhKUFZQ4Bz2hfwpZVYBJppu+/QLsicS+T0WbgEwskbejchHVLkIAH8m4bFRZMdZdoCxkGoLHqmPYWhacRR53/sUPT8wDrS7CjSlPrlRfwcAJEcuUTxpHipxnmqWEEkPLkWsDiyLNauMrFVqkCQ== 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 b20-20020a05640202d400b0055ef56f4575sm2600068edx.39.2024.02.12.02.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:22:19 -0800 (PST) Date: Mon, 12 Feb 2024 11:22:18 +0100 From: Andrew Jones To: Samuel Holland Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH -fixes 1/2] riscv: Fix enabling cbo.zero when running in M-mode Message-ID: <20240212-6ac32b7c5fd35daddd2cace4@orel> References: <20240212022642.1968739-1-samuel.holland@sifive.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: <20240212022642.1968739-1-samuel.holland@sifive.com> On Sun, Feb 11, 2024 at 06:26:14PM -0800, Samuel Holland wrote: > When the kernel is running in M-mode, the CBZE bit must be set in the > menvcfg CSR, not in senvcfg. > > Cc: stable@kernel.org > Fixes: 43c16d51a19b ("RISC-V: Enable cbo.zero in usermode") > Signed-off-by: Samuel Holland > --- > > 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 510014051f5d..2468c55933cd 100644 > --- a/arch/riscv/include/asm/csr.h > +++ b/arch/riscv/include/asm/csr.h > @@ -424,6 +424,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 > @@ -448,6 +449,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 89920f84d0a3..c5b13f7dd482 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -950,7 +950,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 > In case we take this one instead of Deepak's Reviewed-by: Andrew Jones