From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30C10C369B1 for ; Wed, 16 Apr 2025 07:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Subject:Cc:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3hgWTf1oOZQ+kNQ9Zi5YDgDfbkbFdIJthIrzxG36rm8=; b=RDIVFgv1LnqyoJSZ2ZMuGhISDJ XL4cKXDxEbGim1baluBGCOQdiomPECpMaH6gXjVLk/KRifKnprQQ3C/FhnxHMVKUPF78GqC6DrWap +LPcgauH7X1Mn71UzNIwZHxdGjqc4z/8mJOqSVCKDpRPBJuTgZOOdh/8lb0q3QaHQrzt+KLxT2FX8 lXn4vNg3p5xXpA7gdk1n5MuIlHdNzcHt15U/apIf3Keyp5p54CFrqalF/9lSquqZyyHye0Bf/wcmO CElaCYRLmDXVpp08pCa3Vl2ToqrqCHHtDsYS5GETX/1SnqWPNv46N3u/JU4WXGzps6am+Pivb1pbi KcIvJ1lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4x6g-00000008b4y-21g0; Wed, 16 Apr 2025 07:22:50 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4x3Y-00000008aIm-1M2R for linux-arm-kernel@lists.infradead.org; Wed, 16 Apr 2025 07:19:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 892385C5B16; Wed, 16 Apr 2025 07:17:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35CFFC4CEE2; Wed, 16 Apr 2025 07:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744787975; bh=L1F0iz+mGjxASpELFwE+TVnNzquaENAnd+uAheImZyI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YIM+gkhjyg2/4XI5rQHG5SaZj/eHH3qjAJvtu59bFvDiJ5jOD4cVTw8xhKKgoM2n8 mqU4j5lNhXhVaCootafp45UIFJJdKIi6u/Yw7NPVph2C9mjWY0RtUlTmZU/qHGC3jt 8TiPsv6u1Nz6Is2jhMUMQYegEcXn6nyHUeBBHuDY6/w9V99lBiovQ40ADkzabqyCKE 8wVJRCzd4RBWQuYWeaDLq8Mt/7KHJU0ZG3hdT94FoEsty4mSgLyGPIH4sCmUlW4+Wz SeVemhXMb75PioKUWRTJ81/kRdt+o3UO+VfOqzHudewXiEumpT0NdDNFdY/ldHFh27 bw99kCoj38/lQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1u4x3U-005wvK-S8; Wed, 16 Apr 2025 08:19:32 +0100 Date: Wed, 16 Apr 2025 08:19:32 +0100 Message-ID: <86wmbkk1yz.wl-maz@kernel.org> From: Marc Zyngier To: D Scott Phillips Cc: Catalin Marinas , James Clark , James Morse , Joey Gouly , Kevin Brodsky , Mark Brown , Mark Rutland , Oliver Upton , "Rob Herring (Arm)" , Shameer Kolothum , Shiqi Liu , Will Deacon , Yicong Yang , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH 1/2] arm64: errata: Work around AmpereOne's erratum AC03_CPU_36 In-Reply-To: <20250415154711.1698544-1-scott@os.amperecomputing.com> References: <20250415154711.1698544-1-scott@os.amperecomputing.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: scott@os.amperecomputing.com, catalin.marinas@arm.com, james.clark@linaro.org, james.morse@arm.com, joey.gouly@arm.com, kevin.brodsky@arm.com, broonie@kernel.org, mark.rutland@arm.com, oliver.upton@linux.dev, robh@kernel.org, shameerali.kolothum.thodi@huawei.com, shiqiliu@hust.edu.cn, will@kernel.org, yangyicong@hisilicon.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250416_001936_465698_6B453075 X-CRM114-Status: GOOD ( 15.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 15 Apr 2025 16:47:10 +0100, D Scott Phillips wrote: >=20 > AC03_CPU_36 can cause asynchronous exceptions to be routed to the wrong > exception level if an async exception coincides with an update to the > controls for the target exception level in HCR_EL2. On affected > machines, always do writes to HCR_EL2 with async exceptions blocked. =46rom the actual errata document [1]: If an Asynchronous Exception to EL2 occurs, while EL2 software is changing the EL2 exception control bits from a configuration where asynchronous exceptions are routed to EL2 to a configuration where asynchronous exceptions are routed to EL1, the processor may exhibit the incorrect exception behavior of routing an interrupt taken at EL2 to EL1. The affected system register is HCR_EL2, which contains control bits for routing and enabling of EL2 exceptions. My reading is that things can go wrong when clearing the xMO bits. I don't think we need to touch the xMO bits at all when running VHE. So my preference would be to: - simply leave the xMO bits set at all times (nothing bad can happen from that, can it?) - prevent these systems from using anything but VHE (and fail KVM init otherwise) This would save a lot of maintenance hassle and the extreme ugliness of this patch. Thanks, M. [1] https://amperecomputing.com/assets/AmpereOne_Developer_ER_v0_80_2024082= 3_28945022f4.pdf --=20 Without deviation from the norm, progress is not possible.