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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FA62C433F5 for ; Wed, 13 Oct 2021 15:58:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0792B61168 for ; Wed, 13 Oct 2021 15:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236129AbhJMQBA (ORCPT ); Wed, 13 Oct 2021 12:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236312AbhJMQA4 (ORCPT ); Wed, 13 Oct 2021 12:00:56 -0400 Received: from mail-wr1-x44a.google.com (mail-wr1-x44a.google.com [IPv6:2a00:1450:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C53B8C061760 for ; Wed, 13 Oct 2021 08:58:49 -0700 (PDT) Received: by mail-wr1-x44a.google.com with SMTP id 41-20020adf812c000000b00160dfbfe1a2so2375671wrm.3 for ; Wed, 13 Oct 2021 08:58:49 -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=geKOuDyapRPU6is2PIHNocmWi3CmDJ2JnpgjpVKS/bU=; b=VN++2S+k4KN11UpNmg8AFQd0V1g+GIwPCw0Aq+JGPbUyihxnFmzsQSjAQWJFFjtaNm YYyApUmsmPcCpglJBS0OcaxZiObaBCtCRWdAcMluLCbf9XZeWJNDLP+/YN4gnsmUw/f7 xZoAHQ0KIU3Z9WWrkwvKBpCF+1Aaxuw+GPZHCqSAmBBFKgOICUlNmDE9bQXcKoPjsW5j qdrcCUUxcrJnn6YKO7/p/oFhIV5I4JFfwjL4N46KjxY96Z+o1Y9z1MCRtDQ1cIV2V2ST svmcIQV2XP3IGVQgY4dBe1Q0RNlIo0cD+KFGU4K6IAmRkQQkkco+HEFX3nhr9v6m70zt BFKA== 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=geKOuDyapRPU6is2PIHNocmWi3CmDJ2JnpgjpVKS/bU=; b=H96oQwUlq0Gua+AXjCAhjcjKonWZM4ZLpwuhgP1fqJ2uDL7eu6ec+KGpNM2C9jbh9F 93Tqp2EGMD9rDhqnDV480JyHyNvxO516DrtN6GLFmiyL/j5KhwGUVH2ZWB2hm8A8MdXI hHhrCXXYHVFct4GLg/CUZXkrWsLewCvJ9GjaCZM7pe2PT9VAfJvNVv74p7m1cvB6qMM8 xoake75+eSRjbbNjIsU3tGPv3GkRRJhiiDjrdecndSpBKNAGafrDCKLv4LGUUfTCtiA8 aYLFEF0admtQPwE8NmeCIhlj2AiTxjamAttcJ82APX9sw3ngtBF1Ox9oYMB1na1Bc9dP J+ow== X-Gm-Message-State: AOAM530SnECn0R6m4BwCdX11yJMy/i0VumXejlSCeyz4AlIsNWLIbRNv 1jZ8LNgPDkkEmfUAZT/lkILPEybKYTdM X-Google-Smtp-Source: ABdhPJz0XCfJeYia0X1UAzFkedYN1KhyaiIYXjxhsEH0zsNp+ml8wu+2Vv+dlUCbDB1lFLK95GPgHM0lsljj X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:65b5:73d3:1558:b9ae]) (user=qperret job=sendgmr) by 2002:a05:600c:4fcd:: with SMTP id o13mr14107564wmq.158.1634140728272; Wed, 13 Oct 2021 08:58:48 -0700 (PDT) Date: Wed, 13 Oct 2021 16:58:21 +0100 In-Reply-To: <20211013155831.943476-1-qperret@google.com> Message-Id: <20211013155831.943476-7-qperret@google.com> Mime-Version: 1.0 References: <20211013155831.943476-1-qperret@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH 06/16] 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 Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kernel-team@android.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.882.g93a45727a2-goog 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33044C433F5 for ; Wed, 13 Oct 2021 15:58:53 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id D1E98611AE for ; Wed, 13 Oct 2021 15:58:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D1E98611AE Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 847914B12F; Wed, 13 Oct 2021 11:58:52 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GcGV3x3m4DJQ; Wed, 13 Oct 2021 11:58:51 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7BD484B0B9; Wed, 13 Oct 2021 11:58:51 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 213854B092 for ; Wed, 13 Oct 2021 11:58:50 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KtgtWhqEJayX for ; Wed, 13 Oct 2021 11:58:49 -0400 (EDT) Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 29FFA4025B for ; Wed, 13 Oct 2021 11:58:49 -0400 (EDT) Received: by mail-wr1-f74.google.com with SMTP id j19-20020adfb313000000b00160a9de13b3so2359655wrd.8 for ; Wed, 13 Oct 2021 08:58:49 -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=geKOuDyapRPU6is2PIHNocmWi3CmDJ2JnpgjpVKS/bU=; b=VN++2S+k4KN11UpNmg8AFQd0V1g+GIwPCw0Aq+JGPbUyihxnFmzsQSjAQWJFFjtaNm YYyApUmsmPcCpglJBS0OcaxZiObaBCtCRWdAcMluLCbf9XZeWJNDLP+/YN4gnsmUw/f7 xZoAHQ0KIU3Z9WWrkwvKBpCF+1Aaxuw+GPZHCqSAmBBFKgOICUlNmDE9bQXcKoPjsW5j qdrcCUUxcrJnn6YKO7/p/oFhIV5I4JFfwjL4N46KjxY96Z+o1Y9z1MCRtDQ1cIV2V2ST svmcIQV2XP3IGVQgY4dBe1Q0RNlIo0cD+KFGU4K6IAmRkQQkkco+HEFX3nhr9v6m70zt BFKA== 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=geKOuDyapRPU6is2PIHNocmWi3CmDJ2JnpgjpVKS/bU=; b=2Q17BI+MC3UW2c8et9EkyXS+5ET9ALyaQ00roO8dPSy+8ezJdY2I3nbcZuo844mM0M XAvND1ryWxKsiFilYL+zDIv98MnLwW1Y3/i7Le8Nl3l19yREI3CJpY8V0gSNVOVDqFGB Y3jy3tBajuYm7MU3qbVTXiDIV2vVk2Jwvk57567wKTncG8OaNe3E17gFbPufAuAZul/N Ga5jJe7tq4kCJzjP9LA0B0pv+2NEbtspMOm6Fza6+nIPhedQYnFhlQYrAb9DqiaUD8rC uzbDmF4Dtd93OcM5jPXmnBvurvGEjA5ToGYaqwzqJGG/27LGou+llplzoxXtuTpJaMUz hGJg== X-Gm-Message-State: AOAM532CDBD9QAeYp9+t0/dIzMJ4moIIa3gvfWnNmuBDNpXWp/CG7r2o g+MAFoPE+kzNgT/5k4xtZqTK9uMehUde X-Google-Smtp-Source: ABdhPJz0XCfJeYia0X1UAzFkedYN1KhyaiIYXjxhsEH0zsNp+ml8wu+2Vv+dlUCbDB1lFLK95GPgHM0lsljj X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:65b5:73d3:1558:b9ae]) (user=qperret job=sendgmr) by 2002:a05:600c:4fcd:: with SMTP id o13mr14107564wmq.158.1634140728272; Wed, 13 Oct 2021 08:58:48 -0700 (PDT) Date: Wed, 13 Oct 2021 16:58:21 +0100 In-Reply-To: <20211013155831.943476-1-qperret@google.com> Message-Id: <20211013155831.943476-7-qperret@google.com> Mime-Version: 1.0 References: <20211013155831.943476-1-qperret@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH 06/16] 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 Cc: kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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.882.g93a45727a2-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 015FEC433EF for ; Wed, 13 Oct 2021 16:02:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C39926109E for ; Wed, 13 Oct 2021 16:02:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C39926109E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=wElK5CQf/fqoOohFSIc3+rhVb3tdUPQGb0u8jiQJRH0=; b=SavZpZtEG9ha4KwNl7QvSyBMAA 0LkGRVw+VDE8dmRGfjZ9KHfsdjfrjoIBlcdoYkyKYNoNFz9PVb131OSzqa+AtnN73tdUjHe7YfB6e w9cupFgPBQYaCjKqKHsxv+FfBtBN+A0Qbl0y7AII2W/mzeZaUf0EB313nH5ksGmoyawXLBEVgMwsD uFcvW9Ribz4TDFD/zyDsQ5NNI2z8zlrPkptSt/UGshjP3SNtRyyZdX+rCiu1sLhov7sfpdpVHC7lo 54xoCLdBOeEd7wdmBg5jKsvDknbs4UMZbJWJwGxbRJSHG8yoWQ5cwETKhZPILCc/3AVckyzQXVS2h vHewgyTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1maggb-00HU90-UB; Wed, 13 Oct 2021 16:00:58 +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 1mageY-00HTMJ-FP for linux-arm-kernel@lists.infradead.org; Wed, 13 Oct 2021 15:58:51 +0000 Received: by mail-wr1-x44a.google.com with SMTP id a15-20020a056000188f00b00161068d8461so2358704wri.11 for ; Wed, 13 Oct 2021 08:58:49 -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=geKOuDyapRPU6is2PIHNocmWi3CmDJ2JnpgjpVKS/bU=; b=VN++2S+k4KN11UpNmg8AFQd0V1g+GIwPCw0Aq+JGPbUyihxnFmzsQSjAQWJFFjtaNm YYyApUmsmPcCpglJBS0OcaxZiObaBCtCRWdAcMluLCbf9XZeWJNDLP+/YN4gnsmUw/f7 xZoAHQ0KIU3Z9WWrkwvKBpCF+1Aaxuw+GPZHCqSAmBBFKgOICUlNmDE9bQXcKoPjsW5j qdrcCUUxcrJnn6YKO7/p/oFhIV5I4JFfwjL4N46KjxY96Z+o1Y9z1MCRtDQ1cIV2V2ST svmcIQV2XP3IGVQgY4dBe1Q0RNlIo0cD+KFGU4K6IAmRkQQkkco+HEFX3nhr9v6m70zt BFKA== 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=geKOuDyapRPU6is2PIHNocmWi3CmDJ2JnpgjpVKS/bU=; b=bQBHK4bN5R9ZnmcGVi3IBf/Q6dd/Vel2U+fcQLR8+EsgIcpsv0AHRti/pv27synBmH lKdb+Qakq7Xft/+pjNndggh0J6dQoBxW0Rp5vWUU1Vb2viUSZQu3qaNHhgteu5bItWPQ wdNMGg3dy1Qqk8yuUSSX09TQX+cWdRpCeFL3WKCUzYp2vjNG/ej0gxH69lW9S/JeTzBk Ef55P/9Q0QYDhvo6s3qZ/CiDWw/engFHG20py3hFujp5JTfKz22FmSUx+dCK+NCJ0s3f a0mAdE8zDk5YiDFolLdXRopaHRz2kj+9erkkwEI22ymz86EG7QXhCiaAI7bBW2COC5Jz xHrA== X-Gm-Message-State: AOAM53066G/jgEe/pNzSVUWLSlg4AwZtAlretGWJ0lRD7oUh0XfgD7lh ZUiagK20Gh62h/jZnO2gcrQUGDV+Fnpm X-Google-Smtp-Source: ABdhPJz0XCfJeYia0X1UAzFkedYN1KhyaiIYXjxhsEH0zsNp+ml8wu+2Vv+dlUCbDB1lFLK95GPgHM0lsljj X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:65b5:73d3:1558:b9ae]) (user=qperret job=sendgmr) by 2002:a05:600c:4fcd:: with SMTP id o13mr14107564wmq.158.1634140728272; Wed, 13 Oct 2021 08:58:48 -0700 (PDT) Date: Wed, 13 Oct 2021 16:58:21 +0100 In-Reply-To: <20211013155831.943476-1-qperret@google.com> Message-Id: <20211013155831.943476-7-qperret@google.com> Mime-Version: 1.0 References: <20211013155831.943476-1-qperret@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH 06/16] 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 Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211013_085850_558144_C615DB6E X-CRM114-Status: GOOD ( 11.98 ) 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 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.882.g93a45727a2-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel