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 25D0BC4332F for ; Thu, 20 Oct 2022 14:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pbGrQYRPAQcxWV0KPGjL25krGof7cwqMX0SsGF3fKeQ=; b=lKwnk/xGdWEiZW hUaQrQl6qeeBU9MeXmyQ39zirdJsdaYTBZXeUNBQBmg5obAaaC+hYvYVvyo4YiIUappQ+vF8bQjWu IzcxDwBqTyuV5N903OZ+lpLBydvM6akUr6eu5AvVzuuE8FKgao0K5r+M9/buX0kxrVa+2JdSYaKst /6QZhTtyr7kGeev9W1aRzPn+zIkd+QqBosfvtKd4TpP4nFSDaI+NDAPRByDIRS2VJ+zzba45QbuFz /64iugnoz862LJVIelhaL8Ts6pIDNA3zOj7TNSGuAxeXAnZJt1/2Wh/KRD50WZ7BedEglS8mfwMvI qtKZClrL7vqq7Ubes8Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olWDG-00FtMN-3S; Thu, 20 Oct 2022 14:07:58 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olVmF-00Fata-K9 for linux-arm-kernel@lists.infradead.org; Thu, 20 Oct 2022 13:40:05 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2686F61B6C; Thu, 20 Oct 2022 13:40:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5978BC433D6; Thu, 20 Oct 2022 13:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666273202; bh=TlmuoizYiy7ocLRUX9ITRdoDGCG+RyLE/kBvsyVSA4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aa/5NEzMxgzRNWleNJNolE1U55vS35EzGe9SwJ6FNEF4MPkp3vmDTnetSeop+T74y vk2QDFiRb/NYbcjTTDoezEmwgG2A1B1bUr3K5jh2lvo7CpmkGEsEIjzICrpcCdaNco uVZUfjr1mJ1BO9Mq/3SlsOfajSYwTSGIhd9T47VERTUv6pEJeQ9koLNcsO5j1jXtU2 TDOQnyBTm1eirC4Pmb6Ely3BK4IPsHlPmMspTsU/6+d8iLisz56ZFmbsyPz7kajsVC Ihfl8BKBuBlbQA/Mdgq3YVZpdCtmDBWY7SkT2gbHZiWW4q8f953QDrW1N83Ays+S2B KTANdPphuHT1A== From: Will Deacon To: kvmarm@lists.linux.dev Cc: Will Deacon , Sean Christopherson , Vincent Donnefort , Alexandru Elisei , Catalin Marinas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Mark Rutland , Fuad Tabba , Oliver Upton , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 23/25] KVM: arm64: Explicitly map 'kvm_vgic_global_state' at EL2 Date: Thu, 20 Oct 2022 14:38:25 +0100 Message-Id: <20221020133827.5541-24-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221020133827.5541-1-will@kernel.org> References: <20221020133827.5541-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221020_064003_765354_ED3317B5 X-CRM114-Status: GOOD ( 13.27 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Quentin Perret The pkvm hypervisor at EL2 may need to read the 'kvm_vgic_global_state' variable from the host, for example when saving and restoring the state of the virtual GIC. Explicitly map 'kvm_vgic_global_state' in the stage-1 page-table of the pKVM hypervisor rather than relying on mapping all of the host '.rodata' section. Tested-by: Vincent Donnefort Signed-off-by: Quentin Perret Signed-off-by: Will Deacon --- arch/arm64/kvm/hyp/nvhe/setup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kvm/hyp/nvhe/setup.c b/arch/arm64/kvm/hyp/nvhe/setup.c index 0f69c1393416..5a371ab236db 100644 --- a/arch/arm64/kvm/hyp/nvhe/setup.c +++ b/arch/arm64/kvm/hyp/nvhe/setup.c @@ -161,6 +161,11 @@ static int recreate_hyp_mappings(phys_addr_t phys, unsigned long size, if (ret) return ret; + ret = pkvm_create_mappings(&kvm_vgic_global_state, + &kvm_vgic_global_state + 1, prot); + if (ret) + return ret; + return 0; } -- 2.38.0.413.g74048e4d9e-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel