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 23B02D2CE12 for ; Tue, 22 Oct 2024 17:31:34 +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=uCKrbtzT/k31xR5TLZtJICh1Pq2pCZQa78PAsxkZJVM=; b=CqIctMdlCnwIi4Op+lRQcv1qE3 mfgYpq1I0Jay1eJ65EB3ykN+co65DIw6/Iv+/XYnDy85qanRGpTBd9+D96ff5/6x1K6Bipg/1LW/o 9bD/MsWiiCKBEYwmMWcmYFS9dQpl+EyfxUT/nGiTGvpuj2FlnTylr8WZTWCOFGoawC1uWFQKe1v6M 8CENlnRyVcOvKDwrp8NrQ0eLAsTXYuNq6MwouPFxrjEpOIpdng0/IhRVnLr1rxpXBOj2FztpfZUPP S0V7NONYDqSkzF3egp7Ub6YyT2c4Mmi5qBCeDBSoO4Pvs5czkQcq75qP+snijKVlhEj3kmd7CSpd6 y47cn52g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3Ij3-0000000Belz-0JzB; Tue, 22 Oct 2024 17:31:21 +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 1t3IG0-0000000BZxW-1sik for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 17:01:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5FD125C4C66; Tue, 22 Oct 2024 17:01:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A254C4CEC3; Tue, 22 Oct 2024 17:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729616479; bh=Iatc3b/jGBS3/w0k/JE4kf/vo+9y4c4akyAfEBSaE2E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o5OuzqSipgJeNlpuQS8SCxcFINr4edXxEP9QJPxf0ouVOPfwTAYOoxi2pfhnx5NAT pPw98Pz7CPWen4YX9aQ2VcgaQZ835w8+WS1H9PnHifD6potGRm6AcfJMr79JyIH8dS 2hP0W/cOiTSjmzcfyV3I0lgfFV9U45q9q9p+BppIiM2p0zlpzdeahatEWabKsb7O3+ UL9Z3Bik9T9WcgbEVMwZIe2YXSP1mpHFLdrBxSsfc+kDQfikmowligqVplwCV3DYqD zbLIg9o/uHHPnMuStO5gE2T4x8CZ2Qq5S/4yps04rNQTi/BkW1c9ABuKrvUyyNPuOc JMlexzlcS2LeA== 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 1t3IFx-005qr0-G5; Tue, 22 Oct 2024 18:01:17 +0100 Date: Tue, 22 Oct 2024 18:01:17 +0100 Message-ID: <865xpk3wde.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Oliver Upton , Joey Gouly , Fuad Tabba , kvmarm@lists.linux.dev Subject: Re: [PATCH 2/2] KVM: arm64: Don't map 'kvm_vgic_global_state' at EL2 with pKVM In-Reply-To: <20241022144016.27350-3-will@kernel.org> References: <20241022144016.27350-1-will@kernel.org> <20241022144016.27350-3-will@kernel.org> 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: will@kernel.org, linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev, joey.gouly@arm.com, tabba@google.com, kvmarm@lists.linux.dev 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-20241022_100120_599542_A5FFBC6C X-CRM114-Status: GOOD ( 24.63 ) 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, 22 Oct 2024 15:40:16 +0100, Will Deacon wrote: > > Now that 'kvm_vgic_global_state' is no longer needed for ICC_CTLR_EL1 > emulation on machines with a broken SEIS implementation, drop the > pKVM hypervisor mapping of the page. > > Cc: Marc Zyngier > Cc: Oliver Upton > Signed-off-by: Will Deacon > --- > arch/arm64/kvm/hyp/nvhe/setup.c | 17 ----------------- > 1 file changed, 17 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/nvhe/setup.c b/arch/arm64/kvm/hyp/nvhe/setup.c > index 174007f3fadd..8fec099c2775 100644 > --- a/arch/arm64/kvm/hyp/nvhe/setup.c > +++ b/arch/arm64/kvm/hyp/nvhe/setup.c > @@ -95,7 +95,6 @@ static int recreate_hyp_mappings(phys_addr_t phys, unsigned long size, > { > void *start, *end, *virt = hyp_phys_to_virt(phys); > unsigned long pgt_size = hyp_s1_pgtable_pages() << PAGE_SHIFT; > - enum kvm_pgtable_prot prot; > int ret, i; > > /* Recreate the hyp page-table using the early page allocator */ > @@ -148,22 +147,6 @@ static int recreate_hyp_mappings(phys_addr_t phys, unsigned long size, > } > > pkvm_create_host_sve_mappings(); > - > - /* > - * Map the host sections RO in the hypervisor, but transfer the > - * ownership from the host to the hypervisor itself to make sure they > - * can't be donated or shared with another entity. > - * > - * The ownership transition requires matching changes in the host > - * stage-2. This will be done later (see finalize_host_mappings()) once > - * the hyp_vmemmap is addressable. > - */ > - prot = pkvm_mkstate(PAGE_HYP_RO, PKVM_PAGE_SHARED_OWNED); > - ret = pkvm_create_mappings(&kvm_vgic_global_state, > - &kvm_vgic_global_state + 1, prot); > - if (ret) > - return ret; > - > return 0; > } Maybe add a note indicating that nVHE/hVHE still have that particular mapping via the rodata section? Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.