From patchwork Mon Jun 12 21:04:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13277476 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 CE0FCCA9EA2 for ; Mon, 12 Jun 2023 21:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 662058E0003; Mon, 12 Jun 2023 17:10:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 611AC8E0002; Mon, 12 Jun 2023 17:10:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5000A8E0003; Mon, 12 Jun 2023 17:10:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 448B98E0002 for ; Mon, 12 Jun 2023 17:10:59 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0BFC1A0332 for ; Mon, 12 Jun 2023 21:10:59 +0000 (UTC) X-FDA: 80895340638.19.2F09E23 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by imf02.hostedemail.com (Postfix) with ESMTP id 2398180004 for ; Mon, 12 Jun 2023 21:10:56 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="ARcBZ/w+"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.167.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686604257; 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=z6EpXhLB/ZnHGYzIKEyphwqiyS9zUDTms38NuP0TFmY=; b=mzoJdF8GqPVbUdAW7gubBjjhE3AeU3SL0g6SRY+kx5xrF/NhzmiVJJFVocNvgMt5GTn+aI PqpFAsJr1C26kTLsVJBIfCm6fw3Q1+5jBdI9BoTtTP3ek3faZITvxx4OIo/7m187KTVATq NFH12TNfK8bVodL/0enS9ioYjMVAe9U= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="ARcBZ/w+"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.167.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686604257; a=rsa-sha256; cv=none; b=YRTg1Lm8kM4vFExj/+evnD/RzXy8guBAwQUCU1BHr3lR/Xu3X6QfUpkhR5Cz8ewLTNo4gx VOh/16Cnv7EfRkiLuG8NNzvBpjuGfTKg8hNnIQpeNoRi3AucarKPjwAR8FW7r6mJNusatB S7F+bjsRPDm6CQRYx3uTDCk2C7CjJP4= Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-39c84863e34so2974166b6e.2 for ; Mon, 12 Jun 2023 14:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686604256; x=1689196256; 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=z6EpXhLB/ZnHGYzIKEyphwqiyS9zUDTms38NuP0TFmY=; b=ARcBZ/w+ET6+vo/M+ZNUWyvOFXjH3ciL7VK+UOaTs03oCnb23jE7dCJAxA3UCkikRc 2ST+cZ2kauooiUFYSd9t56X/ZFO6QR0+nOqr+qX/JXVSiW4K718hDQ0USAEtZ4tyPw0w Pj7wHQLMbUPe93apSUMuregt8Xl0CgfcxLq4QsIgJ0wtWJ1/7Np1r80Xnskik8O3XoKD Oc/29A93BDs3V7buyiV15mgP/zmA050DPJSziskyn0H4qVUJY7A8Ctj0yrRP8t9Jm+Lp Txp3blP5noiGKCrfuDEvxwwnKz+4z3oC0jMpIiI0n/rwa6zWKXk0AFW6/uL/MuglJ1GN y1WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686604256; x=1689196256; 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=z6EpXhLB/ZnHGYzIKEyphwqiyS9zUDTms38NuP0TFmY=; b=BHme6ydi6O6MO5Er1ZzAgnnHDr2n+RzJqgb9YIVqBt99DLEiwhOEJUxfRfQ4t9uVi9 dMs6oMwle/doDT0PmofUXbN/d7NCfq1FSlhoWodHAqU/elvC8nOnCtMsoLa/Xafb/E7o IiMF5mo3GH2YswMp0SxuMqVR6mNhbZBK0LDCBTH0lLL6T4UasDIIsMr1PinjNPM4kYvn LVTd2sCguf9KM4ZceTmYONAr6oDUWw1EwiE3Le9o30cNhPia+FDrEEsG9CU4XepjQKX9 11/n2ITud7yHuMMb6KVvAanoGFZrETlZRoB03eTuPF/U/H65Mg157h3Tc2iLIm0NP+Wi 8KZg== X-Gm-Message-State: AC+VfDzLM6sLVr4F65ax+2xmUUd/VWPtRrSVHhWLugMYVCGVO7RJvYt+ 8gf1PNPt2BpFUHsCGDkMFASDIrU5ctfOlg== X-Google-Smtp-Source: ACHHUZ45RyLy6yl6Drr+w1zJryROJeWNSP67xpIchmrzxG/I82VOblMbJJSkZ2edvv8Qj+2hZ+73Vw== X-Received: by 2002:a81:7bd6:0:b0:565:d517:e714 with SMTP id w205-20020a817bd6000000b00565d517e714mr7606123ywc.25.1686603949233; Mon, 12 Jun 2023 14:05:49 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16]) by smtp.googlemail.com with ESMTPSA id s125-20020a817783000000b00569eb609458sm2757115ywc.81.2023.06.12.14.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 14:05:48 -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, Hugh Dickins , "Vishal Moola (Oracle)" , "David S. Miller" Subject: [PATCH v4 31/34] sparc64: Convert various functions to use ptdescs Date: Mon, 12 Jun 2023 14:04:20 -0700 Message-Id: <20230612210423.18611-32-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230612210423.18611-1-vishal.moola@gmail.com> References: <20230612210423.18611-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: u1w88hjinbdcp6newt7h5ybhi7epm51m X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2398180004 X-HE-Tag: 1686604256-593079 X-HE-Meta: U2FsdGVkX1/yz/fqFa4wDHAddqn482+VRZpzZ5K3d7TlpUT6khARjIotHF8CeRMZLML1XNneOukDdzD04U1wXSJVOKwjEHgFSOhqkFOf1MLK6iOTqMOvEAetENfstn93mVsggLeHPtzMQGWjTUHMdxuOsNGAwrZ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gZOPOlmG/wHTU8RyvToGqURDZRYflr+z27+PZwii2LLZzAQZ7ruWpj+/nvWiBcOeNVvfJpnInXQMgzPiX3whgK3ANRv8PaPUzTyxeJacsXLe+6mceHedOdkqCe/OWujLu52clfJmDnZ1ql57szuICio5h5Id2aL3R9RpEDEMKIsWq2Mf2fipD0kIg4vDwdY+qmB/8FtkGODvMBxPnDbZr67DJkdfgzN/jWKFMmTB1dbWncJeRBpnaAx4LrmYOnu+nvB7EFJE62Ya4w== 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) Acked-by: Mike Rapoport (IBM) --- arch/sparc/mm/init_64.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 04f9db0c3111..105915cd2eee 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -2893,14 +2893,15 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm) pgtable_t pte_alloc_one(struct mm_struct *mm) { - struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO); - if (!page) + struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0); + + if (!ptdesc) return NULL; - if (!pgtable_pte_page_ctor(page)) { - __free_page(page); + if (!pagetable_pte_ctor(ptdesc)) { + pagetable_free(ptdesc); return NULL; } - return (pte_t *) page_address(page); + return ptdesc_address(ptdesc); } void pte_free_kernel(struct mm_struct *mm, pte_t *pte) @@ -2910,10 +2911,10 @@ void pte_free_kernel(struct mm_struct *mm, pte_t *pte) static void __pte_free(pgtable_t pte) { - struct page *page = virt_to_page(pte); + struct ptdesc *ptdesc = virt_to_ptdesc(pte); - pgtable_pte_page_dtor(page); - __free_page(page); + pagetable_pte_dtor(ptdesc); + pagetable_free(ptdesc); } void pte_free(struct mm_struct *mm, pgtable_t pte)