From patchwork Tue Jun 27 03:14:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13293847 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 C8129EB64DD for ; Tue, 27 Jun 2023 03:16:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63CF48E0014; Mon, 26 Jun 2023 23:16:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C4198E0002; Mon, 26 Jun 2023 23:16:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F0DE8E0014; Mon, 26 Jun 2023 23:16:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 23C0F8E0002 for ; Mon, 26 Jun 2023 23:16:14 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F0E38B0013 for ; Tue, 27 Jun 2023 03:16:13 +0000 (UTC) X-FDA: 80947064226.03.D2D0225 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by imf24.hostedemail.com (Postfix) with ESMTP id 38A7A180009 for ; Tue, 27 Jun 2023 03:16:12 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=PChVo0lf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.174 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=1687835772; 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=2x+E7/HO6cxS1FKNHsH+YAjV99GeoJ7wX0XOkEEtc8g=; b=oy5AUc1IjjR/KQglndQz9UhRMzRdv5kuRdsDcHja//62l7zxmlW4zyVXZI/2g5ZeY3tJVp q7Uo2+Zu/NzrHY5zVzcRkB3mVFr0FaPmsXV1Zc3Kg1GWqegc/+p05usddLHXEZdLXlfVp6 lEdL6gae4ak+fzABagjBBofL2EiIQ4s= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=PChVo0lf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687835772; a=rsa-sha256; cv=none; b=i8Hu1G8oec/KN9gBOM66BgakQtOu63G0S+Yrctp+6lNEP/o/QfzxYh021adnadiPdCG6Ip D0a7Ki8VxHRDTauM/k+KwSl/0WVynaTeu76dakq4aTH6gs6LKEkDkxMweq1JhsUPFE7Ond jGczBUAcEVXyfwkWbCYMnEaimWK1qjY= Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-57026f4bccaso42392307b3.2 for ; Mon, 26 Jun 2023 20:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687835771; x=1690427771; 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=2x+E7/HO6cxS1FKNHsH+YAjV99GeoJ7wX0XOkEEtc8g=; b=PChVo0lfe7Am1Juwq3iG7RGGrP0XqVtToprVlSbVPrmyTboyAd49pm1+evSB9B2tFw kXjlu6Q/E8ApcKDqDyfQ8SExeWZmFlXQXipKcu1XJWfNM69YhOWXhf3ISbUTXIBhFgb0 96QCzhEZra+XSmonTSpvrhyWNfhcBtgM1hIeMstisaUf5aqytakahkQIURxFAuMmzadV 6ZXbtsztDtfR61NxP+OmIDHBWYbrG0Ze8ny7+vi6zis0kg+kLkgyVN6ua8e4P9XYJM+O StKP4NZwkZwEtlTvPnxWtxrHSt+7T/pJDNCTHMVfEfjXHYKpAk/tbkRioOk7ft8zrct2 Kzpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687835771; x=1690427771; 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=2x+E7/HO6cxS1FKNHsH+YAjV99GeoJ7wX0XOkEEtc8g=; b=KKxfaQErTbFXSX8CwgcPUBsHqmJ07FqqRukLyaoQdJOANJvLDDb3BaaNCSITcGbqqk 9AVOk/QJH39vRNCzowrLGbGoMdEjiSFTYcpyqC6L2wo4R/NSZwrz3vOZSXSvuBDDb2eD gUqk7JKIncIvUa0K9RS5j4XRUzb+5JJH22WhfQCEv7I9gcW6RtaPKxRZyDtu+QXMmE+s 3Hd982O/TaVmnqAM0I8LdTYKtS+2RCBH1Nyf+7O/4ha/bGJshxYLtDKrdT+ISsZoUkSS W+qyvNduroNQSOtuQOlpewWvkXPAnbuaMBFHGd4QwqislOWiUD0imj858e+gZqRo+HDw iTSg== X-Gm-Message-State: AC+VfDx8rylM8zphxEP8CxeBj+kkTM15VypV4/IC9KE+MwbfGlSAMPU1 H5J1WTI/sEK+oxWMhEXBoXs= X-Google-Smtp-Source: ACHHUZ6W45+nYYtPli9FO9SD+YRunw+Uuhdk8hdZzeF/68wsjhLAFg0GoFHHxkB57Ykeq0XvBZGu+Q== X-Received: by 2002:a0d:e293:0:b0:561:d25b:672a with SMTP id l141-20020a0de293000000b00561d25b672amr31395214ywe.21.1687835771352; Mon, 26 Jun 2023 20:16:11 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16]) by smtp.googlemail.com with ESMTPSA id s4-20020a0dd004000000b0057399b3bd26sm1614798ywd.33.2023.06.26.20.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 20:16:10 -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" , Mike Rapoport Subject: [PATCH v6 30/33] sparc64: Convert various functions to use ptdescs Date: Mon, 26 Jun 2023 20:14:28 -0700 Message-Id: <20230627031431.29653-31-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230627031431.29653-1-vishal.moola@gmail.com> References: <20230627031431.29653-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 38A7A180009 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: qmyezm5w5jmqohp1imorhqgfduij8s41 X-HE-Tag: 1687835772-817607 X-HE-Meta: U2FsdGVkX1+hx1Aj1XayN7YyzX1z7GlbeKJAdm3X8yF7O3Wnr/TcOBCBkd1zTHYVBW+wM1uTs2XPWbOTxm0dIRZu/0nZzmGsiE3XdE1wwo5RGiZStszOe/UcUV4MsgkswOBypxCNrAH28NHN46VVq7F4UHjvE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HoDiFqwvsxjK6dIKg47uXTG+zD6Oz8lVBOGiF/keK6dXGkdyTFxUqAEGI4Opw6wY/tEcRdHKCwR5O4QUPPrqJe2muQ/ylCYK5LF1bveF0C+crvCb1XFycIjyrqiv5q3+lGCJ0zURVhCNO+vBHS6Qiq/SQhJFxhlSDTOjorGSeIRGYL+GaO0LljIjg6vEGwUhyK+yuH3fN0+x+qfV+ptjM86XWQQt9qqUadUfSrCfdmGFmp7M8KUL3+3PLnONiP7/HHItcYT/ADbkengjBbcT3CUgmkwVpm0uT1RY60+ETMv68v5IGDeCzFaZacqb7E8v7KUGckWsFOxnM9EvMbS3Ey6xypw84IWXw== 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)