From patchwork Wed Dec 8 15:22:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12695379 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 9E1A7C433F5 for ; Wed, 8 Dec 2021 15:34:36 +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:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EA9djU0KllCl0MeK1VIzW1sLFefoYtcgrsXQTQzGyr4=; b=rQNha+8J/wxQbHlSXKqXy0a36j PIcz1uqi2bzzoHnQ8HGirD3t3xrDriM7KTuJIG1dY7G2ruMxAEpfypMEVqGk19H/5VfPAMU6zMy2f C7RUYOti08C6DL2I8qD+4X4cEAm4bUFMxMXUawmu+8GG2bvq9y2yfUtjz6QeTTonRNID+xFJnjSNy pc9wAHoL6L62IEMUez9H5rEsfWbTUhchZ5Y9FKTY3KT2UB0ML6xUU8xyvPkx+gA9f4Ejfbz5P2mHW TCh/b4ZqQCi4mWl2LcRn6waotxO3APagrNPvivMEaZBpq0TFPq116A8nrBjOcHEe1zBPtJcmuezud jGgXNJ9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muyw1-00DHAB-NP; Wed, 08 Dec 2021 15:32:46 +0000 Received: from mail-wr1-x44a.google.com ([2a00:1450:4864:20::44a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muymr-00DCkg-Oh for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 15:23:19 +0000 Received: by mail-wr1-x44a.google.com with SMTP id q17-20020adff791000000b00183e734ba48so480911wrp.8 for ; Wed, 08 Dec 2021 07:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=dgTcer4H5x2V6vg1108kd2kvmSCOK/fdrPt0IEA/yAc=; b=OO++pgN0LQkRixb3Sq7Hd5w4QXWKTHU22mu8fVnumx/eTq9CxL7X2F8nL4x04jkISf kipUAI4bu44wE9v5DHK56LMB2no0ObvfG7M8kGv5bzcym0vpdnDAJ8Lk4yq+49UtdWo3 bZ8yP9xdUCTiHdkctcvrwAgccOD0TBjeYFZucZKb836bHeZhaqsMS2NSKTW1g1P7/re0 9AgPiRniaapcw/g+FhGxeT0goa83px619Dqwd1v+txQWUZTOE5sF8onQT6zmISmitbWL 81NrTCgrmHgZ5NfFOREPevSqkUNFg6S1AEJOfg+NXVGsl4K9TjJThlPj455oD1dIYaT3 +3JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=dgTcer4H5x2V6vg1108kd2kvmSCOK/fdrPt0IEA/yAc=; b=cAQXzkiBYaLqOJXaU/aqoc81mX6Nc6nTpyCq9SBkBZdirR5qK7l5gJXzjF5ftcT6OU swYX5Wa1gklTdP4dhO9XUo9ea1/ZVzLS4Mbts74mK19hMyAcijMlcNwButByMw5hVmW7 +AZU3QX1rD2v/v4ol8ph3+aqTl3mSAM4gP59G5RUtk9RMaUNGB8ltt//fDoctsWFlRzU 6aPxjr+27rWdS8v/FiVb/2LxTVW3FIw4a9vs1UWXWesXEmQqR2r4kFnpCf3HF59F0W1q up68Ogjvalc333RsHDHR2J6+g1c3xmm9ksXqV9ZC+5iR/mtFkumVfjVNo09uvvF6sFM6 1GLw== X-Gm-Message-State: AOAM530TZPhJas0hOHiSTe1mZ/DLcgBi+rPYEaMcbJMeA7RHN5XkoXxe wqAvDvS+boA1HWLR9esrnboowwJEzptk X-Google-Smtp-Source: ABdhPJzw57yyhlFRsGBdsMP0b1MuPYqG3wH3zEnWZDUhTXBl2eHsIR7+DocFx3KMxHXiRp33Wa8qily/O8bz X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:c718:14b8:982a:57d5]) (user=qperret job=sendgmr) by 2002:a7b:c407:: with SMTP id k7mr16929430wmi.35.1638976994756; Wed, 08 Dec 2021 07:23:14 -0800 (PST) Date: Wed, 8 Dec 2021 15:22:57 +0000 In-Reply-To: <20211208152300.2478542-1-qperret@google.com> Message-Id: <20211208152300.2478542-5-qperret@google.com> Mime-Version: 1.0 References: <20211208152300.2478542-1-qperret@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 4/6] KVM: arm64: Make __io_map_base static From: Quentin Perret To: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kernel-team@android.com, qperret@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_072317_873636_68400C50 X-CRM114-Status: GOOD ( 12.40 ) 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 The __io_map_base variable is used at EL2 to track the end of the hypervisor's "private" VA range in nVHE protected mode. However it doesn't need to be used outside of mm.c, so let's make it static to keep all the hyp VA allocation logic in one place. Signed-off-by: Quentin Perret Acked-by: Will Deacon --- arch/arm64/kvm/hyp/include/nvhe/mm.h | 1 - arch/arm64/kvm/hyp/nvhe/mm.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/include/nvhe/mm.h b/arch/arm64/kvm/hyp/include/nvhe/mm.h index 3f60d6cc5368..2d08510c6cc1 100644 --- a/arch/arm64/kvm/hyp/include/nvhe/mm.h +++ b/arch/arm64/kvm/hyp/include/nvhe/mm.h @@ -12,7 +12,6 @@ extern struct kvm_pgtable pkvm_pgtable; extern hyp_spinlock_t pkvm_pgd_lock; -extern u64 __io_map_base; int hyp_create_idmap(u32 hyp_va_bits); int hyp_map_vectors(void); diff --git a/arch/arm64/kvm/hyp/nvhe/mm.c b/arch/arm64/kvm/hyp/nvhe/mm.c index 9e0ff5a700dd..526a7d6fa86f 100644 --- a/arch/arm64/kvm/hyp/nvhe/mm.c +++ b/arch/arm64/kvm/hyp/nvhe/mm.c @@ -19,11 +19,12 @@ struct kvm_pgtable pkvm_pgtable; hyp_spinlock_t pkvm_pgd_lock; -u64 __io_map_base; struct memblock_region hyp_memory[HYP_MEMBLOCK_REGIONS]; unsigned int hyp_memblock_nr; +static u64 __io_map_base; + static int __pkvm_create_mappings(unsigned long start, unsigned long size, unsigned long phys, enum kvm_pgtable_prot prot) {