From patchwork Mon Apr 17 20:50:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13214579 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D1FFC7EE22 for ; Mon, 17 Apr 2023 20:53:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44E216B0075; Mon, 17 Apr 2023 16:53:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D790280005; Mon, 17 Apr 2023 16:53:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DFE2280004; Mon, 17 Apr 2023 16:53:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 01DE56B0075 for ; Mon, 17 Apr 2023 16:53:16 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CB4D41C67DF for ; Mon, 17 Apr 2023 20:53:15 +0000 (UTC) X-FDA: 80692083150.23.3135756 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf23.hostedemail.com (Postfix) with ESMTP id 13B30140018 for ; Mon, 17 Apr 2023 20:53:13 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=VrQ0lWqr; spf=pass (imf23.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681764794; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oJJ/5JNaAhhn0BtCWyESRHZW29NfaaBB7RT6Dtpfjog=; b=S1tO4UDR0BqbrH4ubbH5Sf+bJynbp0jT8PGEJSmJU1a0CMRbvk6pSLHMnPd6i8vRBYoySz rG+y9pUcQeOWXEWssP7pFwbP5hqvBPIvUbIW2OqekH9ChqEAXAAYEyrk6PExwu+V6kBjJr XbabI8s3CjxI4hnOQ5FmYowlCVtusb4= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=VrQ0lWqr; spf=pass (imf23.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681764794; a=rsa-sha256; cv=none; b=CZD8o98eUwuMfvmH1ztaeZtZYV0aUdzHEx3eP/ax1xulhSyJyx09eQcQJtUXFsY8WqmBL9 T7VYTG429j6ANx+BJjRgRuIOoAbJGpU7n7rE+bxnLedV9IMqS20YP7anBw4bIunETzWYOy Erw7TJlW4VaCq+7TylrQ5LX+wA4AFS8= Received: by mail-pj1-f46.google.com with SMTP id k36-20020a17090a4ca700b0024770df9897so6599530pjh.4 for ; Mon, 17 Apr 2023 13:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681764793; x=1684356793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oJJ/5JNaAhhn0BtCWyESRHZW29NfaaBB7RT6Dtpfjog=; b=VrQ0lWqrs/ZeVvxhrMkEnri25zysQvP6rvUVlziuAvcyoO7aiCs2Ip8nrZdL+4djlt EalUxXukap5u9TcR0Ypqd1nj4oCE7Zy1crkVgOFcBvFvQfkcdrgLVV5yu4aZ8sXiNQzS MzbdyHaLybqiTpdHLCapkJdM135ufCzQfSX7LCwPasNWotwzcPJsMf59UKAQgZOOczBx ZYZuB1ddeu/80rtF2gv16gY+bwHM4NdL4pbXt10qFjUxYFen/hCDj/7OzFab+Hq/fc/w UWRA/d9TiIVFZRkxxpOQPugklzg3SfxU/z6fpq4Q2x5DyNF+cvnkXmPJMDWg2KdcBHj4 X1Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681764793; x=1684356793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oJJ/5JNaAhhn0BtCWyESRHZW29NfaaBB7RT6Dtpfjog=; b=VRGBJkzYGm+b1gTNFqbd8rxHSwGsb8Hs3GEIp+ktkR0byJ+bUhWz9vRe0zKJMMG2ag aeRvbV57wlkavt05NOvb+E/Cigt65vAjEKnA3RUhnVl+dwV2F+6LsoKswnq8lg9eXYDE aF12PrTiUTlWQDXFClYNiCbPHs1FtdEHyYFZBqwDVTaXz1qqRJl3N9F7aJ4amPVK/7km Rjps/b/VhVhBxG5UU+2DxMX62ItNDBrRrnORrdanCrK7tk2xi5v4ebXe3Cz19WZhZoss tWyUoJ8pwKTVUooj/MzWm17hrKUWyqZm2BsBeif42p2wBb+gXSFf4Znr7XvlGzifJVVf zU8A== X-Gm-Message-State: AAQBX9eicL6HEMjJt81b0iJLvvz1VYeYV1YELWZkhU1PE1NZ4F9KcBHL 054GDvgOiSYjbhYWZgL6F+0kU5k9NT9QqA== X-Google-Smtp-Source: AKy350Y2w7IaE9PrAymAnxztuomQd4Ga7koe4Zw+ByQfv97VTbICRP51vtaSBBH4u41LkAvC07UcrA== X-Received: by 2002:a17:902:bd86:b0:1a6:c6d4:5586 with SMTP id q6-20020a170902bd8600b001a6c6d45586mr227041pls.13.1681764792942; Mon, 17 Apr 2023 13:53:12 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:937f:7f20::c139]) by smtp.googlemail.com with ESMTPSA id h7-20020a17090ac38700b0022335f1dae2sm7609707pjt.22.2023.04.17.13.53.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 13:53:12 -0700 (PDT) From: "Vishal Moola (Oracle)" To: Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH 20/33] arm64: Convert various functions to use ptdescs Date: Mon, 17 Apr 2023 13:50:35 -0700 Message-Id: <20230417205048.15870-21-vishal.moola@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230417205048.15870-1-vishal.moola@gmail.com> References: <20230417205048.15870-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 13B30140018 X-Stat-Signature: 4amsxqg4d7h1i9unn6jpu6d3oqk5wy1j X-Rspam-User: X-HE-Tag: 1681764793-569360 X-HE-Meta: U2FsdGVkX18luDHcgvlyiNw9PFFvLjCbFEbv+nC4B8ixS3BxVXRIELQ0RjvOBsD+/TBWgnPYEh0xY/VIj5+vOnEHFTCZQ+Mp1FwIYByQRsIH2jRgh9B5M1X2BQ+dE66MuXlLTBuOuWv/+lid7yyzanAzCsTRHMmiCqyWev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N4oofZ9YoVzru+PFfEbIsFgFJhJr5lb0nG4vJpOVgnVSz4B5bqdNwjAzwEL/GrNYtgqEuAHKt93THUbXRAAeEgVaJFWOri/gqVT1UwwJ4DjkSdSxEpa8CvhioPA1rh+PjPZvudThq4MN9o0IwlVGXl8wN/hV0BRtxWKJYrOydBrT+/KIWfsTF9/EaBvsnNa+V4kjnzW1KMMaK4s7IubqqAU9UGW7XzjNtBGRCleyEVd19H27bGN6Ix3u5nEZ7e+zfnMVl9SKRh0x1NwuKv3GV9ZRe218O/W6NbxZCjAEMIL4k= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Signed-off-by: Vishal Moola (Oracle) --- arch/arm64/include/asm/tlb.h | 14 ++++++++------ arch/arm64/mm/mmu.c | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index c995d1f4594f..6cb70c247e30 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -75,18 +75,20 @@ static inline void tlb_flush(struct mmu_gather *tlb) static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr) { - pgtable_pte_page_dtor(pte); - tlb_remove_table(tlb, pte); + struct ptdesc *ptdesc = page_ptdesc(pte); + + ptdesc_pte_dtor(ptdesc); + tlb_remove_ptdesc(tlb, ptdesc); } #if CONFIG_PGTABLE_LEVELS > 2 static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr) { - struct page *page = virt_to_page(pmdp); + struct ptdesc *ptdesc = virt_to_ptdesc(pmdp); - pgtable_pmd_page_dtor(page); - tlb_remove_table(tlb, page); + ptdesc_pmd_dtor(ptdesc); + tlb_remove_ptdesc(tlb, ptdesc); } #endif @@ -94,7 +96,7 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pudp, unsigned long addr) { - tlb_remove_table(tlb, virt_to_page(pudp)); + tlb_remove_ptdesc(tlb, virt_to_ptdesc(pudp)); } #endif diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index af6bc8403ee4..5ba005fd607e 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -426,6 +426,7 @@ static phys_addr_t __pgd_pgtable_alloc(int shift) static phys_addr_t pgd_pgtable_alloc(int shift) { phys_addr_t pa = __pgd_pgtable_alloc(shift); + struct ptdesc *ptdesc = page_ptdesc(phys_to_page(pa)); /* * Call proper page table ctor in case later we need to @@ -433,12 +434,12 @@ static phys_addr_t pgd_pgtable_alloc(int shift) * this pre-allocated page table. * * We don't select ARCH_ENABLE_SPLIT_PMD_PTLOCK if pmd is - * folded, and if so pgtable_pmd_page_ctor() becomes nop. + * folded, and if so ptdesc_pte_dtor() becomes nop. */ if (shift == PAGE_SHIFT) - BUG_ON(!pgtable_pte_page_ctor(phys_to_page(pa))); + BUG_ON(!ptdesc_pte_dtor(ptdesc)); else if (shift == PMD_SHIFT) - BUG_ON(!pgtable_pmd_page_ctor(phys_to_page(pa))); + BUG_ON(!ptdesc_pte_dtor(ptdesc)); return pa; }