From patchwork Mon May 1 19:28:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13227940 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 0FDA4C7EE26 for ; Mon, 1 May 2023 19:29:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2808280014; Mon, 1 May 2023 15:29:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D76428000C; Mon, 1 May 2023 15:29:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 851E1280014; Mon, 1 May 2023 15:29:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 73E9128000C for ; Mon, 1 May 2023 15:29:07 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 596EE1C71B7 for ; Mon, 1 May 2023 19:29:07 +0000 (UTC) X-FDA: 80742674334.09.D1FF9CB Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf11.hostedemail.com (Postfix) with ESMTP id 8E1214000A for ; Mon, 1 May 2023 19:29:05 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=dujVT07h; spf=pass (imf11.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.176 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=1682969345; 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=rV9nLkq/IyE4+rG+YNUjdGkNEQ5H37Hr5RYo5DGvKtmxur5wd6w39QTocnwK9eOYxUThlq aSeVsirAXJeXjfNM/W2lUzVDjnIL0ozrlNh6lI8T2KhM5+okGwQ7Zp7kUpDdlOTjlCP+yv mkfD/6/EasCqVSV/degQ3X/a+o4fsFc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=dujVT07h; spf=pass (imf11.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.176 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=1682969345; a=rsa-sha256; cv=none; b=vlBtzjfuazCYusHJ6WOwJiH9pzxl66ZP2RgvAqbfIZv1Ka6B9dGSMZhoRz4KAA3B+7x5ew Lc/gaVO4Et3pxM6VNp//B3NUCOrHJnS0ppWtlCa4o9q5jH8wEINXp8wOyE0qhz2/l90b9H ol+qhSJOjbVLDSe+X19Yru8jrnFfkcQ= Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1aaf7067647so9432005ad.0 for ; Mon, 01 May 2023 12:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682969344; x=1685561344; 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=dujVT07hfeADlXP8VLeHzHZos19FRJjW/aMFZqcOyBAO37TIyuOPUD4cjiEOtYecqR Tiwbs3Jgtkq4Kww3BZLsfUeYGH01HRped6BHBhotJFQfLn1orwI/QFojUqd07/woILZm IdwKD4oQO46zQ5FUSiD0ClypRdGvF7AHFnh12n9hs1VGHXuzfiiaf8+D2bQL3TQLnlID aypLmgidYgZS67oc/+3avE+c7doqeOxXcTi5kAqysB/3bLqLAcTPHmeArfdREDSIi+5K 85L7sVL9riiLJDbWejHR83t0dYjCRXFIJ1/0gZmctdGxqkiAMg4Ak+2alOu75j8lTMAw rYkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682969344; x=1685561344; 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=M/ka68ao5blDnVuVLgmhWItHChnVfyETCAtELqhNo3xbJO73FZSZgzo0XYOq7yvkLx R4CsuZbxF3YGp3o0WnCuQfZ9bwTXWadh7GLnLM+32sI+wOFtSSumgr4NtuBfp5gEpdP3 VJYpcbBAFRbArdXPmbJI1FS7AMjdQ5KrwaSMl+6Pgrasdo1aqO0C9rwK6rFpiy5fLjPz Jn5GLgBE06q+4lVwcCo70pAppwYGZOsV+WzG+MW5UdzF7Lpm89CQADGM1S1ITaMaCfEY bFmgye8xxqRTTIW5n5K1DdNXGMeSqpG3y6L5+5sGT1XDp44y59legpHJT5E7e0OOVXeS XSGw== X-Gm-Message-State: AC+VfDz5n7K5g7SvNm6zD7FgWMGawqpzXQjv0ntFPbZ8vQwaJyha+QmJ IEQzSMuj5bfnxA+/dEgfjp8= X-Google-Smtp-Source: ACHHUZ4ZEnjwtlgm3inm4fu27SXTrMWZSABNUt55ss8dOEDonQf7mUoqMAdyKodh48zsDDd3raB2eg== X-Received: by 2002:a17:902:f68b:b0:1a9:2e3d:fca2 with SMTP id l11-20020a170902f68b00b001a92e3dfca2mr18382952plg.33.1682969344394; Mon, 01 May 2023 12:29:04 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:937f:7f20::9a2c]) by smtp.googlemail.com with ESMTPSA id u8-20020a170902bf4800b0019c13d032d8sm18175622pls.253.2023.05.01.12.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 12:29:04 -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)" , Catalin Marinas Subject: [PATCH v2 21/34] arm64: Convert various functions to use ptdescs Date: Mon, 1 May 2023 12:28:16 -0700 Message-Id: <20230501192829.17086-22-vishal.moola@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230501192829.17086-1-vishal.moola@gmail.com> References: <20230501192829.17086-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8E1214000A X-Stat-Signature: cmpzodqwhybudo7bis5nuk76khwbupde X-Rspam-User: X-HE-Tag: 1682969345-37515 X-HE-Meta: U2FsdGVkX1+zObYPeD4f0QaSFmKHX3s/pZUaT8BYQ72r3xkZKwD84dINVtXLNr7O8RuONKE3qs7L0H4zExuNxvNJsbnCX32LyyJ1tfVvkYayMLjY0nUhDKwDMRF8qzQeJx+v7DAw+xM+BRWpu5dFHp6uMO5ommZtBp9z/2yJS0zBBjjiX9sf9KhS3arCBzdJvFEUfjfGSlQ/km0tcjOA37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jEMWCAvCXdGIlgc6nx3tLJmRCn9fLOQu6D8ujWux6xJBkF//EcXdFatDVBLxVeMEUFo3qUYiRYMcJ7Xv1UOI3E/t7rPWCYIVIPGvr3Ccpuz5wdUpiwedXecfOkG4LI++BLYb8TygmWRhYL39Oh77cQczJhHlTaGl5nfNNqMKMMOVQk/HZn7eKh3hlsdqajMlcMQFLV8ZOKQD3u89rJWXSUVr6wQPMG2GPf9Xb7v1KH9nwN4zzN79ALofrQBA== 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; }