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 F3E717483 for ; Tue, 22 Oct 2024 17:01:19 +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=1729616480; cv=none; b=fZPmStwwHl8KMYWjZoQzqpylUbjV2ViU9trI1F+5fMOuZhAPE2e21CXuWniLYfFxFmgxw1ZCDhDfi+okjiib/ZVLDMt8Tj2ceSttBihMO/OXKKfkZwy4GfR0EPKIIPBjnFl2SPPWYAlw68roJYPuBynVhvD8JexEa6921QA84dY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729616480; c=relaxed/simple; bh=Iatc3b/jGBS3/w0k/JE4kf/vo+9y4c4akyAfEBSaE2E=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=ipS9WQifc4Sb9gNDfJCBIjxGRx63OXsMSpPWph6tKEH5ut7yzemCxPVCV6ZCxx7RHEvvE8lqnHWAQH+pwaR051pFZjXm77ooOSSBt1ZYww1/Q+IrM6igOGOYVXVTBhHAcBNM2Wbz1jAMGOSIT6+h78+DDBUhQCvSZFlImvhCKkA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o5OuzqSi; 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="o5OuzqSi" 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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev 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: 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 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.