From patchwork Tue Oct 22 14:40:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 13845760 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 E5887D2C561 for ; Tue, 22 Oct 2024 14:45:16 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UchMTSxw9yq6mFSVUIzQcW/nv9Z53w0Q8U5+8aG4Yoc=; b=s9aQKcQm/n86LThh91CLHtKrrg 0Of9mT4vmGiz35NexPYGzysAohRES+wF99bdMODLIOcPt5hapBRfr7VbmZBWctMBWpvvEdgSOpgwu 2yC0vl6Vfps9umDg7M0esC+fa0N2Syu4JYP64QfIcx9SNbiWO3ooQp5p5v5RKKw0sczuZSKdnbrwo p3Xt1Jk8lHLQRmO7NoLnfWxzx6vmWY87OQAaHxQG4m0kGFMsfi/e8/xODSfYTX8g6xvayCNxdNLKW RG7uqS0laKJl8baxL4TSbcV/tSCWgHIFg059XjsSTor5Dqq7HZDO+eiDppqNSh5DdxZmYlyEuYDFd Iqg2hibw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3G84-0000000B93O-0n1M; Tue, 22 Oct 2024 14:45:00 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3G3e-0000000B8Nw-1V23 for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 14:40:28 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 59470A43CBA; Tue, 22 Oct 2024 14:40:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB93AC4CEC7; Tue, 22 Oct 2024 14:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729608025; bh=Alv9dWrIr7MfCsksp8/aH8Z898+iDvie7akcrAqRG+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fX28e2+JJqYbWXSriya9TLncm0MwdS7FDoH26Og2tXBerGEmDAtwfVPC9X1FRvoqc qg46ih8q92cQo2005+D9nQxu0gM2PUx5AO3gYG8XfuUpsFy0wPT1hYFr4ILgLwIomn Pge+ftB+jUta0GKA8I9MrHVHkc0/ntJZrIxbSyh8Il7413aiyW1uHlzmmA0Jhk31RP MqTAuW/KHxcDMLzVwKd8njy+rUl3SccKw6R7teC9QgZbv/9aLzIqQj9YsNa8h3WzKr W3RYv1f3AxWPvGxEvYYzbUkuMvl1bMc7AUzsu/P+4P++wAeBdnG/OdM+venLAzg7RJ 1vgJoEjIfgzkA== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Marc Zyngier , Oliver Upton , Joey Gouly , Fuad Tabba , kvmarm@lists.linux.dev Subject: [PATCH 2/2] KVM: arm64: Don't map 'kvm_vgic_global_state' at EL2 with pKVM Date: Tue, 22 Oct 2024 15:40:16 +0100 Message-Id: <20241022144016.27350-3-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20241022144016.27350-1-will@kernel.org> References: <20241022144016.27350-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_074026_482006_066C169D X-CRM114-Status: GOOD ( 13.02 ) 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 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 Reviewed-by: Marc Zyngier --- 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; }