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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3411C433EF for ; Thu, 25 Nov 2021 17:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8T0v5ZVsCwAnANUWX88wHMhedH90lVKbm4TYwMr/HFs=; b=lu80fn/4r/WCqE lh/ZGdUpXTeNp/pg9eBZ0kveWuUKMu1avVUyksD2jflMk2D0UjYX3/LCoWXeGOVHLTLyN6x5x8hWC Ieud9KVVWyMSDoFOhopggv2HX9B6ayOMD6WxxMDMk0pMyjnkSbj6P2AE5In6EOjoNJvh39mQePZz2 hsnaMbgi7G1KNyY9tmNVA+vu7Sa4akHhR+0gvIoPdxSwB/36IetKNr3Y8y5NYvoAiOIvm36NIjWcA 4moOk2v7FcienYwLSn/eV2vDTxf6JwxjRTK2VWy+jVDFPZNe7FFQeZehxjrs6Fyavx1XOSBuSVj+J nJeeZFHXJKLcEvfRJBZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqICV-008Kdm-Rk; Thu, 25 Nov 2021 17:06:23 +0000 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqICG-008Kat-Qq for linux-arm-kernel@lists.infradead.org; Thu, 25 Nov 2021 17:06:11 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R131e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04394; MF=rongwei.wang@linux.alibaba.com; NM=1; PH=DS; RN=12; SR=0; TI=SMTPD_---0UyHRKKp_1637859960; Received: from localhost.localdomain(mailfrom:rongwei.wang@linux.alibaba.com fp:SMTPD_---0UyHRKKp_1637859960) by smtp.aliyun-inc.com(127.0.0.1); Fri, 26 Nov 2021 01:06:03 +0800 From: Rongwei Wang To: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, james.morse@arm.com, ardb@kernel.org, tabba@google.com, akpm@linux-foundation.org, rppt@kernel.org, anshuman.khandual@arm.com, pasha.tatashin@soleen.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] arm64: trans_pgd: unify the use of pmd_populate_kernel Date: Fri, 26 Nov 2021 01:05:59 +0800 Message-Id: <20211125170600.1608-2-rongwei.wang@linux.alibaba.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211125170600.1608-1-rongwei.wang@linux.alibaba.com> References: <20211030183200.51295-1-rongwei.wang@linux.alibaba.com> <20211125170600.1608-1-rongwei.wang@linux.alibaba.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211125_090609_109271_BB80A651 X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In commit 5de59884ac0e ("arm64: trans_pgd: pass NULL instead of init_mm to *_populate functions"), simply replace init_mm with NULL for pmd_populate_kernel. But in commit 59511cfd08f3 ("arm64: mm: use XN table mapping attributes for user/kernel mappings"), adding the check of mm context in 'pmd_populate_kernel'. And 'pmd_populate_kernel' always called with init_mm under arm64, nice to unify its use. This patch make a simple change, just restoring init_mm for 'pmd_populate_kernel' in 'copy_pte'. Suggested-by: Abaci Signed-off-by: Rongwei Wang --- arch/arm64/mm/trans_pgd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/trans_pgd.c b/arch/arm64/mm/trans_pgd.c index d7da8ca..5275ca3 100644 --- a/arch/arm64/mm/trans_pgd.c +++ b/arch/arm64/mm/trans_pgd.c @@ -67,7 +67,7 @@ static int copy_pte(struct trans_pgd_info *info, pmd_t *dst_pmdp, dst_ptep = trans_alloc(info); if (!dst_ptep) return -ENOMEM; - pmd_populate_kernel(NULL, dst_pmdp, dst_ptep); + pmd_populate_kernel(&init_mm, dst_pmdp, dst_ptep); dst_ptep = pte_offset_kernel(dst_pmdp, start); src_ptep = pte_offset_kernel(src_pmdp, start); -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel