From patchwork Mon Jul 11 12:24:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Chen X-Patchwork-Id: 12913468 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 0AED6C433EF for ; Mon, 11 Jul 2022 12:30:04 +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=mlIHMhObmCRe0i+/bSt+smu24dpNB43d4XSclYID8r4=; b=ofRR3Qy0lx7LEk tp/gTJqA+eV0236V6T+q6yf9Le/wGIYpxNT0K7kxKAsjucenk6osPCwbHEVh5eAdNHqNqBWanC6vZ c1OvSIDukCgc5BUGID1eB+ubCE4Z/q4z9zrCTaoKjXMZnenwEHx49W63GveQyRAMwAU68ZY2TEsxC Kt2TE1PmeKB+yxc5XJRx8+QMcUB46ds7PXlNGR/yXRx0JfHTkoVgwdLlHGuOQEjXAid/fkntreS3E cPRzln3oRjXtSruRrg33kpnMT/dbNz2DWYGEH8vcm6KXqkT9EObNZ0GyfULrWJm/OmXmMO6RYoq2t 0xgMvevufsKzl5bBs0zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAsX7-001QAr-NQ; Mon, 11 Jul 2022 12:29:01 +0000 Received: from sender4-op-o14.zoho.com ([136.143.188.14]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAsWd-001Pt1-60 for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 12:28:32 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1657542507; cv=none; d=zohomail.com; s=zohoarc; b=Wj44IkAqMXaiKU22l0jln19+dFZUF2tU1v6Ac7YOgtpb7vvnuFcD34l08N0YVG5nbJN2R/+aYu0sMawgJiFRjkG5NTyizEg5zz82r2G5Fuavr9rJ7dAIm9Gk1uicehNvkJsl5Iu3r4UvzamBKsmZDQXDKHfZpaLKatzU4OGALH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657542507; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=XcBY/Eq5IywNEBwnOGSytrIPNKZEd+GUxWkjesqgdhE=; b=BY4tqD/qFDF9rINfEZzxZKU+DaJNwKdHh1xD5Y+CVu4grzv+a9lvB9jhxgANvAy0p7xxK976w1KMBdDQhMhIIWYrqdY3GrmjDQfK4805g/qdEhPLEpuAkpWRFvkSC2ukCmVBB3pM0XMPR6G/X7TYFDG9NwL93CbGOiuxwQOVyGc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1657542507; s=zmail; d=linux.beauty; i=me@linux.beauty; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=XcBY/Eq5IywNEBwnOGSytrIPNKZEd+GUxWkjesqgdhE=; b=ZtcV/kLTYKL80lJw5yjgoMSBb4kqp2TEbTehtIGGwreBUCqr63ySryzpBf6w5IzY AIKjzm5yLsYgY1zXvcUsf1xJM1Op5zu0c1+cIxJnWup9K6mr8+cTEzpHJXeu4g73b2Y JWLicwjaA0FO8VmTqNcRBsP917DGU9KHhd+PIbmE= Received: from sh-lchen.ambarella.net (180.169.129.130 [180.169.129.130]) by mx.zohomail.com with SMTPS id 1657542504796249.49555353239066; Mon, 11 Jul 2022 05:28:24 -0700 (PDT) From: Li Chen To: Catalin Marinas , Will Deacon , Rob Herring , Frank Rowand , Andrew Morton Cc: Li Chen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/4] arm64: mm: move memblock_clear_nomap after __add_pages Date: Mon, 11 Jul 2022 20:24:53 +0800 Message-Id: <20220711122459.13773-4-me@linux.beauty> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711122459.13773-1-me@linux.beauty> References: <20220711122459.13773-1-me@linux.beauty> MIME-Version: 1.0 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_052831_282161_A8F9C8F5 X-CRM114-Status: GOOD ( 10.77 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Li Chen I'm trying to add struct page support to nomap reserved memory, and have skipped nomap bitmap_intersects check in fill_subsection_map, so just move memblock_clear_nomap after __add_pages. Signed-off-by: Li Chen Change-Id: I5e26fdc3f3e55b12f1acc1adb47fb262c4877ff3 --- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6680689242df..2e7f503837e4 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1537,10 +1537,10 @@ int arch_add_memory(int nid, u64 start, u64 size, size, params->pgprot, __pgd_pgtable_alloc, flags); - memblock_clear_nomap(start, size); ret = __add_pages(nid, start >> PAGE_SHIFT, size >> PAGE_SHIFT, params); + memblock_clear_nomap(start, size); if (ret) __remove_pgd_mapping(swapper_pg_dir, __phys_to_virt(start), size);