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 871EEC282DE for ; Sun, 16 Mar 2025 11:14:14 +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=D7WZz8p4Va87rNdR3XyBsUhR8zmBx3a48nP5klIZIj0=; b=CYAToxRKkAxECCE0eiYRy4buOh mIgDIrLr9l7pfWglZGSUA2zuvhZBxiT3svCBlV8J7tmIO9lGFZbI/F9Gt0T2Ayupi//h4dyXAOmfc 6Wkf0tpj+HAD+UJQnBUSO/BlQ2XthYDCra0FV1rWHsXTe9pneMph8KHkIWt46aXj88nDqiNVDCvMw pqDADCtQJhgYTJLNKReQv4piaO8jASx76eqyH68xgI68B4J0k6ZglgO1XWd4NCTQv2ydTMoHBq77Z K2HkVykEc4TdyJD65Ti8YjF65BH6QycvFJ5zKsnD+cT9FFuQfHEQDV7T6yB5Tv/4Wejo8YfHuA5Ra XaoEg42A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ttlwT-000000006XH-3IEZ; Sun, 16 Mar 2025 11:14:05 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ttlun-000000006Pj-1b3b for linux-arm-kernel@lists.infradead.org; Sun, 16 Mar 2025 11:12:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B1EDD5C425F; Sun, 16 Mar 2025 11:10:03 +0000 (UTC) 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250316_041221_558981_B33BA5F0 X-CRM114-Status: GOOD ( 17.92 ) 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 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.