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 B949ECCD1AA for ; Tue, 21 Oct 2025 12:25:20 +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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eOBByLOhLYJTAau9sNVzVsPMxZ5Av4EdfqDyxG5+sQE=; b=PLn/uhEZD0tCq/FFgOsWYY5nbK 1D4EafNAxjB1s5v51eqBWBMnujBquCGM4zmZjiUtZ/9r7h0SAjE4t9vyjKFBPPpzJG1krtz1M4oPB dUkXKE5qL+ZYo6KVw3/hZBPhN1jknd3zN1tL/sYf/9Wpey29MomvNdv3/9a1awWJniGcKTp5oHoWU IQ8Lgf375AwWxYdyJXGELIl6+0Pc3bzyCOA7ZES9HQlro5qhOVmsVRHLCRCfUkg/N7JaJynQ+1ez8 cuBjefuc6bN2ABXScXOIrgS2N1ec+4Mt6vIAlYffedntSS2w6m2cCwmDs7itC7koUFNqoF/fr/DVh NKbw3fEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBBQQ-0000000GxfL-2mGp; Tue, 21 Oct 2025 12:25:14 +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 1vBBQO-0000000Gxe7-3rfi for linux-arm-kernel@lists.infradead.org; Tue, 21 Oct 2025 12:25:13 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id DE767603EB; Tue, 21 Oct 2025 12:25:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F8D7C4CEF5; Tue, 21 Oct 2025 12:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761049503; bh=QAp0WH1C/zbfZAC6WrcLNYkAgwamHfqX68wiGHk2Ts8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JXpsIlZz/zrd/nzfTJJ5XNltOcWIGmTh8FTDJ3uXwKmN9f58zgtXBBZc5sJOJ9iiw lD4TDc1sDlOtT4mzVIYYdsYL+pkl2h+QwjcqhF7Y6x/xgAaLbz2RjYlIG5XRhSrSgU 4GjTbBa6neRY7T3Cv2pQXbY7LJm3e5zI1NOoqYkhN3NIS57eTrkuyLejkGCOc7VAy9 ez5k+o6N+HgrU8IMjE3GG+n27TgpCXrdL1OdrcaioJ9T3l3NsUci3+WwEWXEefF4C6 RibxOQYv0qMgIdI7tNXdjtE173keuMegx9bQX8vQIYaA/lxdNQGPpNaf6K7AwdboAV Tgoke2Q5++u+w== 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 1vBBQC-0000000FpwD-3dby; Tue, 21 Oct 2025 12:25:00 +0000 Date: Tue, 21 Oct 2025 13:25:00 +0100 Message-ID: <86ecqwwig3.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: <20251021115428.557084-1-liaochang1@huawei.com> References: <20251021115428.557084-1-liaochang1@huawei.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/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=US-ASCII 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, yangyicong@hisilicon.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 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. 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). Allowing such registers to be accessed from within a guest would make it impossible to context-switch or save/restore the guest correctly. You can of course do what you want in your downstream kernel or your own hypervisor, but I wanted to set the expectations on the upstream side. M. -- Without deviation from the norm, progress is not possible.