Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2318874rdb; Mon, 12 Feb 2024 00:03:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWyfy0wHdn7VfvyArO1Fvft8ZDCOdWkq6LqFtJbHEd5p4NlMhDma7ChaXk0HOwaOijZMju8NaEv3u0IhozQgSJpUSMhB+71cPqxsVc8Qg== X-Google-Smtp-Source: AGHT+IHA01qanlieCQhcwNmcBiZpCdefei9SvwBzPGYwc9jyENZPWQ5YOtWvb8FiRUmQOaOROmPE X-Received: by 2002:a17:906:48c:b0:a35:2f7a:385b with SMTP id f12-20020a170906048c00b00a352f7a385bmr4066578eja.23.1707725011402; Mon, 12 Feb 2024 00:03:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707725011; cv=pass; d=google.com; s=arc-20160816; b=TTsJ1xihYvzrX8Gi96IojMq1gHYtzAlm3QK2nKv86uW8B4Wo0MlcWwIkFCOrLomFKy 2k5CnwuVdoEQ6dyuczya2TzrtiuQw0Wl7N2Q203DIcLo7LkMT3fWQQH8/9tSBb8yS8Vp lIpLRWm5f2adQcaNbRm7RbOGnCPWDzJn3wWUi2A8ibfECI0sMlf9QDnSUlmXEeEN73Kb IaydufoGs42lesgEd1HVFTMXCLoCGEe7A3rJH1MvVe/1SDj82AuH/hs9nxAZBoZfPGgp TiIONEOSMRn7s9sLk7sULWboM714oVAdrQ7JrOR6gDikC5AaCuDSaoy3hfF0glLi1BiU TG8Q== 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=GP/sVWgXVTHJrQOMPi64iB98DaJZ8lR+05Jh5m3xwC8=; fh=GkZX7X+4j9v7Zher3d4TQJFdFCqqvB5OaiGmqO+Ei+Y=; b=l9/fyJu68bIlvpVtPTcqoNQOMR7dMUx9KKQ1hbOwRegJKH+elaDs5/fbXVNNoFti5N tAT03awkH8HGwfbF3sKd9ZTQr3HmXXepvC+belX5Ol7byEmnteuQ4Fmfi/s7cZLkagXJ WBcF965VORzerG/jSRRZmGWNqJ9MLnlf8XABfgoFnuNlzrNba1slEOO3FQYwAzml7sYE +HLsFztk9TmpTchUAPVgFoHvfmt4D0OZNSJ1PeiZocHQDLvXPXRBtRHmC6EfZjdBe2hl 2Xu7QsMIWC0AQ8+jUq+DcRe6ycJf8bPK/MfeKP6SNkqf7VaNcZK1D8bhbtwAkeIWc/9n qaPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=DBTaBUVw; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-61181-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com X-Forwarded-Encrypted: i=2; AJvYcCXyonjbkH57xZWtmc7DoErPy6Vb+HN3KJl0QvNRGTJPPcDX5LQq42XndF5He82j87aXRzwTMkqgFTCfhMcG8TisTQYfkOThLcQamC5oHA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t22-20020a1709063e5600b00a388c552722si3563644eji.696.2024.02.12.00.03.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 00:03:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61181-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=@microchip.com header.s=mchp header.b=DBTaBUVw; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-61181-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com 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 9DD681F21C31 for ; Mon, 12 Feb 2024 08:03:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B0D7175B5; Mon, 12 Feb 2024 08:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="DBTaBUVw" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDC7A14F75 for ; Mon, 12 Feb 2024 08:00:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707724847; cv=none; b=rjz92Uks/KVA3EssiN8581Ix+gqhS3E7CszfuZOd8oqU7zATTfvWFajVb4fE//KObTT5l41wXbMv18E3catzTMV5907so8QSFuUtc4hNdRoxW2BLvV9z4asp0Tcl9KbP+uOW0tx3GXrTgFJmecDfasxm8rt8LhEorRkS7T/4Foo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707724847; c=relaxed/simple; bh=7hH3HoelP79fA4EAxydxPVb1FLMbOKAgQjwJa4s2m3A=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Yk8TSDTyWPqiawbhTyLqcNfzCUsijSQL/LnJBGIl2jlQo+yK5g/vq25u7jf/5kjIXRtLtVUh+gQkoMLp+B3ty3lB66gGBhY1F4FGFEtfnDa8bN+V1Gd4yYIyBxT+L+SmHhm9uqLNaEwa7lemO8KtxFFxXBqLpBuFAbPEc/yrkkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=DBTaBUVw; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1707724844; x=1739260844; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=7hH3HoelP79fA4EAxydxPVb1FLMbOKAgQjwJa4s2m3A=; b=DBTaBUVwG0uk4ZlMgYPR5dtHOWDMkL+Y6KfxZWVQCRswPs3l1fT27ZX7 F7Pw7XPD2++J+z+/23JZ16qaVZM1Q9I1ALavtoNNK3mdh+IckhZamBAPq qlUUJvrCIzMbQppA5kse3NuRzm20Nih4wlhY4JD3vo8/0sGeo1eSPb+nG 9b/xDk8e0habK1lkLB7KRpgHvkClXsVrQC9VBybkYPlwQIyy8b2e+6nui tJN64nm87X2MnPmL8majNWERg0/RSGbVVqEJ0G8xSQmKdnipJcVdL5UX9 tIFAPPcFB4icfpKQrzHTHfKIMswt03w30dgxfTQeKrqxvvoIQdFAPGZTL Q==; X-CSE-ConnectionGUID: j3L9bk1uS4yWcLk3T9PAMA== X-CSE-MsgGUID: RWmzpzmsTxGGlYSqjesXwQ== X-IronPort-AV: E=Sophos;i="6.05,262,1701154800"; d="asc'?scan'208";a="17510501" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 Feb 2024 01:00:38 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 12 Feb 2024 01:00:17 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 12 Feb 2024 01:00:16 -0700 Date: Mon, 12 Feb 2024 07:59:36 +0000 From: Conor Dooley To: Samuel Holland CC: Andrew Jones , Palmer Dabbelt , , , Subject: Re: [PATCH -fixes 2/2] riscv: Save/restore envcfg CSR during CPU suspend Message-ID: <20240212-sneezing-lifter-d7d390f764e1@wendy> References: <20240212022642.1968739-1-samuel.holland@sifive.com> <20240212022642.1968739-2-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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L/yK4/dJDBsDnoeq" Content-Disposition: inline In-Reply-To: <20240212022642.1968739-2-samuel.holland@sifive.com> --L/yK4/dJDBsDnoeq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 11, 2024 at 06:26:15PM -0800, Samuel Holland wrote: > The value of the [ms]envcfg CSR is lost when entering a nonretentive > idle state, so the CSR must be rewritten when resuming the CPU. >=20 > Because the [ms]envcfg CSR is part of the base RISC-V privileged ISA > specification, it cannot be detected from the ISA string. However, most > existing hardware is too old to implement this CSR. As a result, it must > be probed at runtime. >=20 > Extend the logic for the Zicsr ISA extension to probe for the presence > of specific CSRs. Since the CSR number is encoded as an immediate value > within the csrr instruction, a switch case is necessary for any CSR that > must be probed this way. Use the exception table to handle the illegal > instruction exception raised when the CSR is not implemented. >=20 > Cc: stable@kernel.org > Fixes: 43c16d51a19b ("RISC-V: Enable cbo.zero in usermode") > Signed-off-by: Samuel Holland On nommu: /build/tmp.RcQwFfgWA4/arch/riscv/kernel/cpufeature.c:967:21: error: expec= ted ':' or ')' before '_ASM_EXTABLE' /build/tmp.RcQwFfgWA4/arch/riscv/kernel/cpufeature.c:967:34: error: inval= id suffix "b" on integer constant /build/tmp.RcQwFfgWA4/arch/riscv/kernel/cpufeature.c:967:38: error: inval= id suffix "b" on integer constant https://patchwork.kernel.org/project/linux-riscv/patch/20240212022642.19687= 39-2-samuel.holland@sifive.com/ Cheers, Conor. --L/yK4/dJDBsDnoeq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZcnP2QAKCRB4tDGHoIJi 0hjAAQCt4j31pCTvptmmA76wZTddnhiSMe01Y8CWQitdGCpgAQEA7HxAbB32HLnX 2BntqCYs/siyDbQdgmD9km29tULQKAQ= =22Gm -----END PGP SIGNATURE----- --L/yK4/dJDBsDnoeq--