Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp291801pxb; Thu, 12 Aug 2021 16:45:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDELCCtaGrfpZv0tMnuYjsSWu5O0DGGk82NYw5gNEbdZOofyRFcRgWDq6cTDKKDyN6Nv/X X-Received: by 2002:a02:a409:: with SMTP id c9mr5863404jal.138.1628811953578; Thu, 12 Aug 2021 16:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628811953; cv=none; d=google.com; s=arc-20160816; b=TWm8wYfgZ0wj9ICLAoRC+WjWgBZ38BZSJBcJIy47dhAcbaqNYeWIdfDLH90Dmugje4 2QN/Q1UQR5x4yLPx+IWzqQLrzYTqIpLRmDPEjsgpSbg/pTLuEXW+hUOacPq5qKmEU7r1 5QFk+RWLM6qDlbT8wR0papN301pKeHGTCdneGB+8zqJG3t7cnxGDC7FUAK2Vf4Gn3V6O qfcFY/iJ8rcDzY0o+zNUowNyq8ivdeSWeXU+t0MSYXP6S12ARjICQ2JEi/UBid8hdRrT iVWgK2tT2qGwSvpNe/mg6nH3AHNm3+kXOMt53PLZs1Vg+yWgHNyGSjxD5elM8ufvpQVr Z8LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8NznkMJWfdHWQj174GR6fABwXZE4173fx/L6nZRXKM0=; b=I13p83QlofzZWlJyG2Wls5PkGorm+g4iOvo/HE7YNfGoLvM5QdwqmR+AjUFg1hSzKz kHBFzZub1zmxw/6nQgXThCK6bO9EP2yXIYRPIxRzNDoFgtOW5E1nlD4nUh1tIDbIv8yS uUvspM/TlRQ1OJ92DhnwD4wKx/yz8q2LOoAOyABo0YIwFUPIdWlycNUZOExajpp0UoW4 +clAYLoQDzOQsJvXPJA/rnyItnNpRmD2R6FULGr/+TAUZY9S+50WDyQxntxhnaYEK7qt QhC2+ZLEFaFw+0jMCo5MKifB62JC8O7J8o3i0ykbQ7omYtKjuE4DyPtjVbisnbTI0WYE uN8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p8eBEeTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t189si5204807iof.92.2021.08.12.16.45.43; Thu, 12 Aug 2021 16:45:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p8eBEeTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238516AbhHLXik (ORCPT + 99 others); Thu, 12 Aug 2021 19:38:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:48738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238060AbhHLXi0 (ORCPT ); Thu, 12 Aug 2021 19:38:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3CC94610FC; Thu, 12 Aug 2021 23:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628811480; bh=756huhpCIkumJJNbUzXKUy3Y4Jb2tLDhfukRVM8geaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8eBEeTBrCxLXIaLILkA2TGAhtbxiRSFBgwckHnqQ5EgTXPG4fpzE9H2hdqfIAbH+ 8255LaxxXNfBXSFz1+BH+10nGjdGLcuav46otwMidYiKWTxqhlFubzPvw7z73sTX17 jXfSGZlKphIU4bGxMIuP2SU2D7AIp8qGOFkx+AyPQV8IB+l7FiykgvLYoz6WXzfy8W P6BwvqPFlYm/eiOT8KXX7skUHeWR/pkQ4Bf0B9GPgBuiSh33x9zmz2RuQeMjECKgFd zx+NM36kRPClDOwJpwC+jdZEk7Fx/LgRKzA1BgGu1NTpSg415ewnkuFQB2aO0QWDgi bJs6uCGfEpgpw== 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 v2 07/19] ARC: mm: pmd_populate* to use the canonical set_pmd (and drop pmd_set) Date: Thu, 12 Aug 2021 16:37:41 -0700 Message-Id: <20210812233753.104217-8-vgupta@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812233753.104217-1-vgupta@kernel.org> References: <20210812233753.104217-1-vgupta@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Vineet Gupta --- arch/arc/include/asm/pgalloc.h | 14 ++++++++++---- arch/arc/include/asm/pgtable.h | 6 ------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h index a32ca3104ced..408bc4b0842d 100644 --- a/arch/arc/include/asm/pgalloc.h +++ b/arch/arc/include/asm/pgalloc.h @@ -35,13 +35,19 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) { - pmd_set(pmd, pte); + /* + * The cast to long below is OK in 32-bit PAE40 regime with long long pte + * 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(pmd, __pmd((unsigned long)pte)); } -static inline void -pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t ptep) +static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte) { - pmd_set(pmd, (pte_t *) ptep); + set_pmd(pmd, __pmd((unsigned long)pte)); } 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)) -- 2.25.1