From patchwork Wed Dec 8 15:22:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12695378 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 C41D8C433F5 for ; Wed, 8 Dec 2021 15:33:54 +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=9ZMKSjr98GazVPGUbqvre/dKBZNtL9IpXVUHzAGvTR0=; b=OYEViSf72iG8+j1wcJf4pHvit0 zannQUqwqiXLbgdJVaBZ8IJvEhwcfRdn76IIC0o7YrVnYFHzYiSf6QT9CoQn4Wp4b/+wIieiBAgPq VReycZPTKkgWV1SmbKoCOQtTPDW9rU69aErsi5SP9WmE2X7zoL2rn1MNT3udNU9ZRRahi0Ctw+Mcm I/qfA+/VZrJMQQRhn7BnBkFIMDlUy93tkvfNwFb4ORhz7xJSXsBlv9d6plgHgxwWecG42i7p2grJr Wz2iZUsJQFpYGpJKByTciBVamt0ENGl88gpm2STOljN9t1HH+vizKbHeRA8HUM7tbY9veVyZrpebP e+TqpdFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muyvL-00DGqs-RH; Wed, 08 Dec 2021 15:32:04 +0000 Received: from mail-wm1-x349.google.com ([2a00:1450:4864:20::349]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muymn-00DCil-US for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 15:23:15 +0000 Received: by mail-wm1-x349.google.com with SMTP id r129-20020a1c4487000000b00333629ed22dso3167055wma.6 for ; Wed, 08 Dec 2021 07:23:12 -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=yo/eXM0M5vLhun4zn7QEhUouednn+qQj5dLApDQTa4k=; b=YQiiyTtUq3FaM4VAJoRYtem6jDT89osDA2RviQd2g7IHWgQJ2hB10vOD4CnqbX80AH Q03Kv0t3cWaNVFH1q6wRsylJ5jUi0wqfgyba5j8cMwuubV0aq//6Yx3rXFD3A7vFd+5a QaJSdPOTGPYL7v2/LTUouYfSPXGBXWEV6dqjmyQm6v5eRnmQFCNoPjtn5tvVgXgzaOXf UvQqBvOuCgat8swSkzUAV+FtJRHigg7wX2okKam46SRWE5L0r64Ce2BYha5fYY273J7A ULh+k1+ojzQY3CDqEKIVR7qDEtjRXHo6xmgkTRZFN2V1FPXKiL26iAIlSpweK5BIkit2 QJrw== 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=yo/eXM0M5vLhun4zn7QEhUouednn+qQj5dLApDQTa4k=; b=FjwR55nI0rdC/b9W3y+3OEHv6YNGCpm33cNJlsVO0gy4KKoYwisCKvjyQD47PT3Hxb eC8TR6zplvOShdeL8fw8ysSonyDFYaGp8JfUv/JKrQvMFeiYtffW1ogHNfFSfIT+3g19 yn3X7QpPRKsY5DSw78d86plmgdJHR3TVDJuxhaFU/18ROIBmZwj9y6saBodJrMUKxsLz 1AclZ+I1ze17rWmnAm1tRmBeve9/UBmEe6O8fUGBphtz6BukzTOoGqIMFERgXvIy0iIn ypsWhzy6FC5jrbzldPqovZHDkOLLyB4ppuCc/1c6f7w3ics4Sqisum3XcfeASAXSn3xx 5Ycg== X-Gm-Message-State: AOAM532k5MX7FNrZObLy944qN17HEFoYgVcx1lZEEar5jim400bu4pw1 uiEPtkwjE5N8S+YjHywktzxvNeJdLlzy X-Google-Smtp-Source: ABdhPJwOfjubqI7meWxcl9D37/U/vlVJzBvp2U2d2RIIBKuRn/8kPhrJIutIwFz0Y5iAUysi8gbYXfV0y2wu X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:c718:14b8:982a:57d5]) (user=qperret job=sendgmr) by 2002:a05:6000:252:: with SMTP id m18mr59432350wrz.117.1638976991841; Wed, 08 Dec 2021 07:23:11 -0800 (PST) Date: Wed, 8 Dec 2021 15:22:56 +0000 In-Reply-To: <20211208152300.2478542-1-qperret@google.com> Message-Id: <20211208152300.2478542-4-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 3/6] KVM: arm64: Make the hyp memory pool 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_072314_041174_5DE24189 X-CRM114-Status: GOOD ( 13.44 ) 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 hyp memory pool struct is sized to fit exactly the needs of the hypervisor stage-1 page-table allocator, so it is important it is not used for anything else. As it is currently used only from setup.c, reduce its visibility by marking it static. Signed-off-by: Quentin Perret Reviewed-by: Andrew Walbran --- arch/arm64/kvm/hyp/include/nvhe/mm.h | 1 - arch/arm64/kvm/hyp/nvhe/setup.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/include/nvhe/mm.h b/arch/arm64/kvm/hyp/include/nvhe/mm.h index ef6a58a04235..3f60d6cc5368 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 struct hyp_pool hpool; extern u64 __io_map_base; int hyp_create_idmap(u32 hyp_va_bits); diff --git a/arch/arm64/kvm/hyp/nvhe/setup.c b/arch/arm64/kvm/hyp/nvhe/setup.c index 51e68a040d8a..e31149965204 100644 --- a/arch/arm64/kvm/hyp/nvhe/setup.c +++ b/arch/arm64/kvm/hyp/nvhe/setup.c @@ -18,7 +18,6 @@ #include #include -struct hyp_pool hpool; unsigned long hyp_nr_cpus; #define hyp_percpu_size ((unsigned long)__per_cpu_end - \ @@ -28,6 +27,7 @@ static void *vmemmap_base; static void *hyp_pgt_base; static void *host_s2_pgt_base; static struct kvm_pgtable_mm_ops pkvm_pgtable_mm_ops; +static struct hyp_pool hpool; static int divide_memory_pool(void *virt, unsigned long size) {