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 D2D1C154BFE; Sun, 16 Mar 2025 11:12:20 +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=1742123540; cv=none; b=P+RjOXmVavdpPvwXRVlTugd6ILAYps0m4rPdual98oHuUGYBG4l+ZuEKXgg28AcKum5uDR3gMxo3iXDeP9AMEPls4bJcp/J9MgXOEH7giHKtV/QypsxOuphyx9qZogKSOL4fRtzGL8k0nKNRanMz0By5W2ZunyVGlB2iu3moJ10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742123540; c=relaxed/simple; bh=4ZEEybcIfeZK2o63kdNPHHfyqeq3KgfN4XgVKPtAg0Y=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=kr0MfiWsPFV0RqsEzQlhrxXlRS2uU5BNdtiqhW1SOuOBIWNqu378FbG4W1qJYfvEzZE2pKVJ/fjPVZPhpYT7J8zTvEztIwjp64hbXtwbMPyZstP8GgfSeagzDF4jow3mDzYEsPT9AO0Eu+5kMhCRmAMdwJOAyCF8d7lBwj3Vs9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Zy7Nkshr; 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="Zy7Nkshr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4255AC4CEDD; Sun, 16 Mar 2025 11:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742123540; bh=4ZEEybcIfeZK2o63kdNPHHfyqeq3KgfN4XgVKPtAg0Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Zy7Nkshr5ieGYILWsYa9Uy1Dmp5VshwsyKYM28vQrc8wFDlTacOYyxQQbdpveKe4v JauafJ9Qas23rkZ27LmBAuSdfS1Xxt6RYxBmgAwbxQ50WfhAgH082JOuLqn+GsVuP8 z3zzwF31HvjREfcOSTg+HjMkJoFG0spfKp3XZdJz9bo1K0JtPlkLCbgUlh2bkELTKF +rjv+dKl0XvYXRXfJ0pmPhMC5mgjIoksVwUhMZWFqGxfWvuKGGPZVw8ynZRhgyjtfY lv/6MK8aSLd+Agi+TrY4I3+j5ticC72ayBGrxRTyZLXTOZybK4jJ92VJKPCWj/oW38 e0LCx6VIH1L8w== 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 1ttluk-00DyUl-1b; Sun, 16 Mar 2025 11:12:18 +0000 Date: Sun, 16 Mar 2025 11:12:17 +0000 Message-ID: <864iztnsa6.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Vincent Donnefort , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/6] Move pKVM ownership state to hyp_vmemmap In-Reply-To: <20250227003310.367350-1-qperret@google.com> References: <20250227003310.367350-1-qperret@google.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) 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: qperret@google.com, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, vdonnefort@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, 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 On Thu, 27 Feb 2025 00:33:04 +0000, Quentin Perret wrote: > > Hi all, > > This series moves the hypervisor's ownership state to the hyp_vmemmap, > as discussed in [1]. The two main benefits are: > > 1. much cheaper hyp state lookups, since we can avoid the hyp stage-1 > page-table walk; > > 2. de-correlates the hyp state from the presence of a mapping in the > linear map range of the hypervisor; which enables a bunch of > clean-ups in the existing code and will simplify the introduction of > other features in the future (hyp tracing, ...) > > Patch 01 is a self-sufficient cleanup that I found thanks to patch 05. > Patches 02-04 implement the aforementioned migration of the hyp state > to the vmemmap. Patches 05 and 06 are cleanups enabled by that > migration. > > Patches based on 6.14-rc4, tested on Qemu. > > Thanks! > Quentin > > [1] https://lore.kernel.org/kvmarm/Z79ZJVOHtNu6YsVt@google.com/ > > Fuad Tabba (1): > KVM: arm64: Track SVE state in the hypervisor vcpu structure > > Quentin Perret (5): > KVM: arm64: Use 0b11 for encoding PKVM_NOPAGE > KVM: arm64: Introduce {get,set}_host_state() helpers > KVM: arm64: Move hyp state to hyp_vmemmap > KVM: arm64: Defer EL2 stage-1 mapping on share > KVM: arm64: Unconditionally cross check hyp state > > arch/arm64/include/asm/kvm_host.h | 12 +-- > arch/arm64/kvm/hyp/include/nvhe/memory.h | 35 ++++++-- > arch/arm64/kvm/hyp/nvhe/hyp-main.c | 4 - > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 106 ++++++++++++----------- > arch/arm64/kvm/hyp/nvhe/pkvm.c | 54 ++++++++++-- > arch/arm64/kvm/hyp/nvhe/setup.c | 10 ++- > 6 files changed, 147 insertions(+), 74 deletions(-) > Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.