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 2AF5BCCD195 for ; Wed, 22 Oct 2025 08:06:11 +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=ourTDyFUCgsIl9KY9TqNMF0VYBTRn7D3yH8JLT7D/S8=; b=srp6RvkNQs90oKw9d6gEfH5zcJ 6Tt1aib19RknoOHQuihJw7fPPo2WNu6epRUywVz62kAuak9qruYDX72GrCfc8BHbf6xi8fJPI24/I ufaDwpVeQ33uGYfpszIdU3F0O9QBlaYL0nS5MaVuzYlC7rElUpULqt8ftX+XQcOME2u78ln25yX8Y F/2zOGNQbtqxDkTgwgMqnj+A2wRMjtFJCJ/ZKcufHgJKEsJIavcX/3FyIOzKtg6JDoTyERLEyZOZW xO0Wcbt3o2HNm5Y5VL9Unh8X93gQGQjqIHDBpuSGa4hupDdKYCNIBmhELXHWGiDLe5aIWAhXQHuON IrnidTgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBTrA-0000000206f-3rei; Wed, 22 Oct 2025 08:06:04 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBTrA-0000000206L-0p8Q for linux-arm-kernel@lists.infradead.org; Wed, 22 Oct 2025 08:06:04 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 799FC628C3; Wed, 22 Oct 2025 08:06:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14654C4CEE7; Wed, 22 Oct 2025 08:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761120363; bh=sEGPFxVuNAAvcbxq9cmERi5JemJMBcOvQ+wey3400IM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kFfAo+E7F7mRth6Qp6bcZHzRhYDaHJ1asp5cb2jSUky6GXKe0h26lajT6YkeNahBh iXitqeoJRyGNUi+OA3B4bit9M/7fzpupAY++s7JK+zw4LXxY/APb3lHefJZ1s+SMnp VHdDht+/dvp/u1UtDeLPn03qXOBFiFyoU8zNxwCiHt2gQN6XT2oBqX6xOD+JTQ9kY8 igU7gVk1bf16OLvFepxZ3rIjn+PgMQUsQ7bvlHeGLfsk5tY+AYQ88RPaELTWDJdaWz nJvs17nvzrUjd6a6FRUv8JyFl34omRMviDlT8KrrF5cDW0WtncjJ1nOO2sq234EeQK tDHIsEttYFU0w== 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.98.2) (envelope-from ) id 1vBTr6-0000000G6ap-1UvE; Wed, 22 Oct 2025 08:06:00 +0000 Date: Wed, 22 Oct 2025 09:05:59 +0100 Message-ID: <867bwnwec8.wl-maz@kernel.org> From: Marc Zyngier To: "Liao, Chang" Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH] arm64: Add kernel parameter to disable trap EL0 accesses to IMPDEF regs In-Reply-To: References: <20251021115428.557084-1-liaochang1@huawei.com> <86ecqwwig3.wl-maz@kernel.org> 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/30.1 (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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: liaochang1@huawei.com, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, paulmck@kernel.org, pawan.kumar.gupta@linux.intel.com, mingo@kernel.org, bp@alien8.de, kees@kernel.org, arnd@arndb.de, fvdl@google.com, broonie@kernel.org, oliver.upton@linux.dev, yeoreum.yun@arm.com, james.morse@arm.com, ardb@kernel.org, hardevsinh.palaniya@siliconsignals.io, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 Wed, 22 Oct 2025 02:35:02 +0100, "Liao, Chang" wrote: >=20 > =E5=9C=A8 2025/10/21 20:25, Marc Zyngier =E5=86=99=E9=81=93: > > On Tue, 21 Oct 2025 12:54:28 +0100, > > Liao Chang wrote: > >> > >> Add kernel parameter to allow system-wide EL0 access to IMPDEF system > >> regregisters and instructions without trapping to EL1/EL2. Since trap > >> overhead will compromises benefits, and it's even worse in > >> virtualization on CPU where certain IMPDEF registers and instructions > >> are designed for EL0 performance use. > >=20 > > Since you mention virtualisation, I want to be clear: there is no way > > I will consider anything like this for KVM. KVM will always trap and > > UNDEF such register accesses, no matter where they come from (EL0 or > > EL1). > >=20 > > Allowing such registers to be accessed from within a guest would make > > it impossible to context-switch or save/restore the guest correctly. >=20 > You've got that right, it seems like both the guest and the host would > need to save and restore those IMDDEF registers with the VM or task > context.The only exception would be if the registers aren't for saving > state or configuration, but instead just act as an interface to trigger > a special CPU function, such as ICC_IAR1. Funny that you mention the IAR register. Because contrary to what you seem to indicate, IAR does impact state outside of simply acknowledging an interrupt. What do you think happens to PMR, APRs, and so on? M. --=20 Without deviation from the norm, progress is not possible.