From patchwork Wed Aug 11 00:42:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 12429671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C97BBC43216 for ; Wed, 11 Aug 2021 00:43:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6911B610CF for ; Wed, 11 Aug 2021 00:43:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6911B610CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 466196B007D; Tue, 10 Aug 2021 20:43:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A12A6B0080; Tue, 10 Aug 2021 20:43:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17FC46B007E; Tue, 10 Aug 2021 20:43:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id CC8FD8D0003 for ; Tue, 10 Aug 2021 20:43:20 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7AFAE1804193B for ; Wed, 11 Aug 2021 00:43:20 +0000 (UTC) X-FDA: 78460950960.15.DF25015 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id 3C149D003D24 for ; Wed, 11 Aug 2021 00:43:20 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A159360ED8; Wed, 11 Aug 2021 00:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628642599; bh=d/hfOn3w687jN4zkC+l2dcxEmGUAtvEy2OYtzBkQRqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pIcHx0LwNdige9Yz4F7qvxqxWWqcdfoJ8KIVPY7/B1MadrCEssQKjIARhkuSMovjY CLivgL8YXgM/F0w6snoahKVCye50IBx3DHZP/jp1eIcXND/dlIopDzGucOi5LpivVa psqbaFcT4/X7E8I3zztdp+CLPCtYIB61CXEeiS49QpQh28ca7ptv/uH8nHdrOMPrJ6 FnBEuAp044ryOyJdP2ICTeLef9KIs4cDzlsTRXJppqroAduldkTk1ndltlPKddFPqZ NMPBEaRZh4mCp5XTnj8pVHpJ1aIf64umV22sGxs9g5vAlipiGgnov0p2eCrgTh1PXm xZ8rMYITTfEiA== From: Vineet Gupta To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual , Mike Rapoport , Vineet Gupta Subject: [PATCH 08/18] ARC: mm: pmd_populate* to use the canonical set_pmd (and drop pmd_set) Date: Tue, 10 Aug 2021 17:42:48 -0700 Message-Id: <20210811004258.138075-9-vgupta@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811004258.138075-1-vgupta@kernel.org> References: <20210811004258.138075-1-vgupta@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3C149D003D24 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pIcHx0Lw; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of vgupta@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=vgupta@kernel.org X-Stat-Signature: 4sppas4imojmycjdm1p8hr5phth3fm6y X-HE-Tag: 1628642600-163228 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: Signed-off-by: Vineet Gupta --- arch/arc/include/asm/pgalloc.h | 21 ++++++++++++++------- arch/arc/include/asm/pgtable.h | 6 ------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h index a32ca3104ced..356237b9c537 100644 --- a/arch/arc/include/asm/pgalloc.h +++ b/arch/arc/include/asm/pgalloc.h @@ -33,16 +33,23 @@ #include static inline void -pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) +pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) { - pmd_set(pmd, pte); + /* + * The cast to long below is OK even when pte is long long (PAE40) + * Despite "wider" pte, the pte table needs to be in non-PAE low memory + * as all higher levels can only hold long pointers. + * + * The cast itself is needed given simplistic definition of set_pmd() + */ + set_pmd(pmdp, __pmd((unsigned long)ptep)); } -static inline void -pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t ptep) -{ - pmd_set(pmd, (pte_t *) ptep); -} +/* + * pmd_populate can be implemented in terms of pmd_populate_kernel since + * pgtable_t is pte * on ARC + */ +#define pmd_populate(mm, pmdp, ptep) pmd_populate_kernel(mm, pmdp, ptep) static inline int __get_order_pgd(void) { diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index b054c14f8bf6..f762bacb2358 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -222,12 +222,6 @@ extern char empty_zero_page[PAGE_SIZE]; /* find the logical addr (phy for ARC) of the Page Tbl ref by PMD entry */ #define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK) -/* In a 2 level sys, setup the PGD entry with PTE value */ -static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) -{ - pmd_val(*pmdp) = (unsigned long)ptep; -} - #define pte_none(x) (!pte_val(x)) #define pte_present(x) (pte_val(x) & _PAGE_PRESENT) #define pte_clear(mm, addr, ptep) set_pte_at(mm, addr, ptep, __pte(0))