From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A091F3587A2; Tue, 17 Mar 2026 11:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773745466; cv=none; b=jMG09dbCaPwKGl+VM4L352Fcr9/1k6FosEEru7ukCi/vkhchAxGDWgF8nFg4X3dwkDICiqmvRy/kwQPtAfIECOcYQ3yV8ugaJbBA5P6FENh2eYPA2+Mi5yh5mCubj3rTeTEprMKl51kQ0931Hh6pmL04AzAYJI9Ljfih0LyTS9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773745466; c=relaxed/simple; bh=9uwr2rgGOQ6RJpK+UxVK8vhB+Xxb2kBp9tC6mUmnV2Q=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=hY+uNPSOotqs0bqgrCJp85Ya8Emkj7xnyqT/Op3nEhHlATeg5hgFpmKq5ZYTQrJpT0kNdbSZcnErTwy5xpSE7yEurUXHjA/dKUID7gdR68ZG/D33Agy+UHRCgZ0DSbqfb5/qiEWZMD7gvbG0DDHL5of++h1NITz1bJt0SKj3qzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kErwT+qM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kErwT+qM" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.