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 2F7E8FD707A for ; Tue, 17 Mar 2026 11:04:32 +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=qcG7ZbcbNBYaAUb866fr71Ob78FoxDmktsEQMdK4qXg=; b=PXhwkFieDXlWvUCdg8logT02GD 35+BopYO+IBto+z3vjiMHvb9kX0pw+XOjiIedD1Yp/y+UAMhQ5qS/XFSyDBdz5HgXco1Ivve2NZ9I 8Qe5TNoLNnsDyse1l2kfbHP74gaVlYP+LcmrXy0V64VCS4rei4TP4xHJTh+8NL+jNI59sywzJk5pq ej6FEdiwAckfenDcwEDowPzbGHgozTw8xXa/eetsiICavH7GiuEaLT3BJiEmP95tV7eHjLlDaAd+S PtEcBZIC1YRjmkvZcCF+kMT+4lsMa8qP0ocR6iTtz+I77pBQrXK5Z7mH5pUAD95YevKIUDuQ6q9Tk QjbQ7elw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2SDt-000000065Nt-0brm; Tue, 17 Mar 2026 11:04:29 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2SDq-000000065Mn-2jO4 for linux-arm-kernel@lists.infradead.org; Tue, 17 Mar 2026 11:04:27 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 5E425419F7; Tue, 17 Mar 2026 11:04:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31C90C19425; Tue, 17 Mar 2026 11:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773745466; bh=9uwr2rgGOQ6RJpK+UxVK8vhB+Xxb2kBp9tC6mUmnV2Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kErwT+qMF3O6WfTtuXoLbNx+xIqdv7wQ0srYltAzySl2JCnEiVpLVFiqfJ/AsOCui zJlV9HaMZaoophm6+dH6GE1e98ZT9IxUGqAkimY3SxU12G8lZN3x34bwsSsavrqaRT 5CxL1a6GVwAXoWi4qmCu28dj+4qSO8YCRgper7pUWRlXIfXS1+W8YB9szfJ6j6hq9H Vybx5lxRJLPj6eTWU7JmZQsfC6ea4aaLtPAjTXAbXOpkWC3Un6O2AYm8sq/d2vhwQV Fn6jIeH1+G6UhDiEBmX4eeID171E5NE/80vA43k9pvCgX53p6zQLJ07e8wTZ515JpS FFUdebVHRK9yQ== 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 1w2SDn-00000002nNc-3zS6; Tue, 17 Mar 2026 11:04:24 +0000 Date: Tue, 17 Mar 2026 11:04:23 +0000 Message-ID: <86o6km67k8.wl-maz@kernel.org> From: Marc Zyngier To: Yeoreum Yun Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, oupton@kernel.org, miko.lenczewski@arm.com, kevin.brodsky@arm.com, broonie@kernel.org, ardb@kernel.org, suzuki.poulose@arm.com, lpieralisi@kernel.org, joey.gouly@arm.com, yuzenghui@huawei.com Subject: Re: [PATCH v17 7/8] KVM: arm64: use CAST instruction for swapping guest descriptor In-Reply-To: <20260314175133.1084528-8-yeoreum.yun@arm.com> References: <20260314175133.1084528-1-yeoreum.yun@arm.com> <20260314175133.1084528-8-yeoreum.yun@arm.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: yeoreum.yun@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, oupton@kernel.org, miko.lenczewski@arm.com, kevin.brodsky@arm.com, broonie@kernel.org, ardb@kernel.org, suzuki.poulose@arm.com, lpieralisi@kernel.org, joey.gouly@arm.com, yuzenghui@huawei.com 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-20260317_040426_709562_5137FD85 X-CRM114-Status: GOOD ( 12.55 ) 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 Sat, 14 Mar 2026 17:51:32 +0000, Yeoreum Yun wrote: > > Use the CAST instruction to swap the guest descriptor when FEAT_LSUI > is enabled, avoiding the need to clear the PAN bit. > > FEAT_LSUI is introduced in Armv9.6, where FEAT_PAN is mandatory. However, > this assumption may not always hold: > > - Some CPUs may advertise FEAT_LSUI but lack FEAT_PAN. > - Virtualization or ID register overrides may expose invalid feature > combinations. > > Therefore, instead of disabling FEAT_LSUI when FEAT_PAN is absent, wrap > LSUI instructions with uaccess_ttbr0_enable()/disable() when > ARM64_SW_TTBR0_PAN is enabled. > > Signed-off-by: Yeoreum Yun Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.