Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp396191pxb; Tue, 19 Oct 2021 05:15:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMuJ4LXDnrojB2K165KtVb6M++5lvlfxV4BmhERPV/7jOha1N/8i3lZ51NvHHMEk/y4ij5 X-Received: by 2002:a50:998c:: with SMTP id m12mr45412624edb.19.1634645740434; Tue, 19 Oct 2021 05:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634645740; cv=none; d=google.com; s=arc-20160816; b=Xt4tUzykTsBut4cM+rItSymMz4JoXAm8qUEFIIyI3IdqbJOoWY+kPKUDwQT1cN2vYY xHxl4awchIJsjqyfl+ay+4u35VmBF/8FUiWQb2fJf6+zxnfmsKia1RYRJLxejQEDGcXE V0z88aIkGc9h3iAWWLGlOfwBKyNgnhgRx7fpf2DKXHojUwdS4NbesgjUnuTzoAa1so7i bikBg1pQMPYNWXSuGBMHN1BEP10gmuP5x2THthsUatE9IkTwQFP/1dMmHxNiuFXgdu1W 3ejtdGra/ig2WVXLcJX+43zJNX++8n61jC5SVD+Y0ATy5lq+WciX25n5hhLeDiBMiWqB IRIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=9qioxcWNTdM29KTskJovFvpNouj7jwaQhn/w48JNYr0=; b=aLVk/14/8yw26Yj7qVyor5U26huqq6DmmTaQrqR+KgU1t7Y1bqibXc6qWFUgXfyF1x h3Db5LKrd9sqezLzpzYZafxw6c7pbc2Df5+y3mBULMuhOwiTu5Jh+hGx4OmbUMpf2omp h7FaRivBifxOUze/1uN4hSQx8ML2eCAEn9V/SyphNGeMU4477jmhtHCm9Kv3x/05UNoA U2tkif2tGWY5axN8g9OwcyQNIgCiVLyTxr+DaxOxU6sCzvTHpbhteWiGPxCDAaCv6J0A BC+v+A/RGuXQby4DBuUWFaLMvcpl6LRNXTegKZFcWbWp2TCCAhm02cbSY0V14kKC4R0L 9ONA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RCVF+kFj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si27294779edp.593.2021.10.19.05.15.14; Tue, 19 Oct 2021 05:15:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RCVF+kFj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235583AbhJSMP2 (ORCPT + 99 others); Tue, 19 Oct 2021 08:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235584AbhJSMPZ (ORCPT ); Tue, 19 Oct 2021 08:15:25 -0400 Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0041C06161C for ; Tue, 19 Oct 2021 05:13:12 -0700 (PDT) Received: by mail-wm1-x34a.google.com with SMTP id k6-20020a7bc306000000b0030d92a6bdc7so1074530wmj.3 for ; Tue, 19 Oct 2021 05:13:12 -0700 (PDT) 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=9qioxcWNTdM29KTskJovFvpNouj7jwaQhn/w48JNYr0=; b=RCVF+kFj8+Q1ZIvAw2o1YEfdbyV/QvERANN2zOL3vp6KFp4sOKvq50TuiuJVXjk8CI sJ8+ANxFKAZIB5XW2WXqgfxqioUa8/FqpJDAAlHYk4VwJzPsMiTKfyXjGsWp6nYM2egs 6ve8/RASgPFUMVKruWnMc+7Dq7xO467GfVDxse/ta3etQdRPTINc1Tn1t35gFQUffSa4 I17Na6p96zob6zezj90RVS7pxK8HHoy186iRxq1vgOzGonEHYihEMN8mRi5acuaAqYmN 0uVSCaCv9OaDCrMFHRsAD+gEn2IzZEReHw70B6v4JZTVux2bKXVrx5uW9Gfu3BqI6frT y8QQ== 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=9qioxcWNTdM29KTskJovFvpNouj7jwaQhn/w48JNYr0=; b=IugALC0pb51Nt5WtTQCFWXfN3X4+YJMhqeKjaGqOwQcoWA3muGEMi6wLGp2zu7l9V9 w42jUgU9Q/px00PkRxbteCANOgVT206RVMvNS2wSQRkspvoEPCmCxyPqPYu+UypGCM+N dz6OHRf6G1g+QWdk8Y9yz8DpdMWW35UDkyPeb2UdeqryYDyJ4uCH6pi0JsFgAdz3Ok4X Bb/Rw0lJuJjZ0mFm16qCoHiEYEsz/pJM+cC18Tky02dnIFeaUrebayE8A3h4hc2p/UhN WLJda95LYYbRH8WzdZSO2jyeJtVn7/+LUgWzo1akaI3WmoDia/Xo5j2lNPD6MQ2UR/Xz 1kaA== X-Gm-Message-State: AOAM5339v9kRK/Urep5EddXRIZeYlhimQtolQ/OwGNrrUPOtks2IVOJN NlsQcOgwP6BykJG/I0m8yFao1W2IbB+j X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:59ca:401f:83a8:de6d]) (user=qperret job=sendgmr) by 2002:a05:6000:50:: with SMTP id k16mr42638419wrx.32.1634645591442; Tue, 19 Oct 2021 05:13:11 -0700 (PDT) Date: Tue, 19 Oct 2021 13:12:51 +0100 In-Reply-To: <20211019121304.2732332-1-qperret@google.com> Message-Id: <20211019121304.2732332-3-qperret@google.com> Mime-Version: 1.0 References: <20211019121304.2732332-1-qperret@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH v2 02/15] KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator From: Quentin Perret To: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Fuad Tabba , David Brazdil , Andrew Walbran Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kernel-team@android.com, qperret@google.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In nVHE protected mode, the EL2 code uses a temporary allocator during boot while re-creating its stage-1 page-table. Unfortunately, the hyp_vmmemap is not ready to use at this stage, so refcounting pages is not possible. That is not currently a problem because hyp stage-1 mappings are never removed, which implies refcounting of page-table pages is unnecessary. In preparation for allowing hypervisor stage-1 mappings to be removed, provide stub implementations for {get,put}_page() in the early allocator. Signed-off-by: Quentin Perret --- arch/arm64/kvm/hyp/nvhe/early_alloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kvm/hyp/nvhe/early_alloc.c b/arch/arm64/kvm/hyp/nvhe/early_alloc.c index 1306c430ab87..00de04153cc6 100644 --- a/arch/arm64/kvm/hyp/nvhe/early_alloc.c +++ b/arch/arm64/kvm/hyp/nvhe/early_alloc.c @@ -43,6 +43,9 @@ void *hyp_early_alloc_page(void *arg) return hyp_early_alloc_contig(1); } +static void hyp_early_alloc_get_page(void *addr) { } +static void hyp_early_alloc_put_page(void *addr) { } + void hyp_early_alloc_init(void *virt, unsigned long size) { base = cur = (unsigned long)virt; @@ -51,4 +54,6 @@ void hyp_early_alloc_init(void *virt, unsigned long size) hyp_early_alloc_mm_ops.zalloc_page = hyp_early_alloc_page; hyp_early_alloc_mm_ops.phys_to_virt = hyp_phys_to_virt; hyp_early_alloc_mm_ops.virt_to_phys = hyp_virt_to_phys; + hyp_early_alloc_mm_ops.get_page = hyp_early_alloc_get_page; + hyp_early_alloc_mm_ops.put_page = hyp_early_alloc_put_page; } -- 2.33.0.1079.g6e70778dc9-goog