From patchwork Tue Jun 14 09:21:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mawupeng X-Patchwork-Id: 12880759 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 524A4CCA47A for ; Tue, 14 Jun 2022 09:00:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD7216B01AA; Tue, 14 Jun 2022 05:00:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C86606B01AE; Tue, 14 Jun 2022 05:00:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4E646B01B1; Tue, 14 Jun 2022 05:00:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A3C776B01AA for ; Tue, 14 Jun 2022 05:00:52 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 60C50141D for ; Tue, 14 Jun 2022 09:00:52 +0000 (UTC) X-FDA: 79576246344.01.E692C55 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf29.hostedemail.com (Postfix) with ESMTP id AF61312009E for ; Tue, 14 Jun 2022 09:00:51 +0000 (UTC) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LMj4W5JmMzRj8K; Tue, 14 Jun 2022 16:57:31 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 14 Jun 2022 17:00:41 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 14 Jun 2022 17:00:40 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v5 4/5] arm64: mm: Only remove nomap flag for initrd Date: Tue, 14 Jun 2022 17:21:55 +0800 Message-ID: <20220614092156.1972846-5-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220614092156.1972846-1-mawupeng1@huawei.com> References: <20220614092156.1972846-1-mawupeng1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655197252; a=rsa-sha256; cv=none; b=wSf7dc4NHrMWTeqU8I3IO24SP4L6mJO9YsMeDt38qk2oRz8Y53LihEPSQM1P7WuTQCVyWi UTQxxv0Jh+hZKJlbmJphAAmy8T7ssUmE5Idcrf0ZC3040yDqCG7SOyahHCVgr81b5x5Ibg gr7T2xAhSHsx5q7ZspnBZ/5Uv895ras= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655197252; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h9w1bvbonppHqIw1BEJHrC36THrwbg/879QbrEvt/kM=; b=UFojwYRS7Cjur/Ho/Hfw5nouR8dlmNPu7W3NUjyhA2J20riQ1hdAF8qEBHYK6MmIY4IbLL eO8xIPcs7csGyUaJZuIsh79MlY1G2HSoqdwsrOi0tp3FA2MvlB2BFmZpv9qFa33tBfy8Ed TKKys0A7XB83w6/aIUy3RxqseCE2y/Q= Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Stat-Signature: gfwkcz1srjd98wrbdgr8rrqmb95mxpdf X-Rspamd-Queue-Id: AF61312009E X-Rspamd-Server: rspam08 X-HE-Tag: 1655197251-887419 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: From: Ma Wupeng Commit 177e15f0c144 ("arm64: add the initrd region to the linear mapping explicitly") remove all the flags of the memory used by initrd. This is fine since MEMBLOCK_MIRROR is not used in arm64. However with mirrored feature introduced to arm64, this will clear the mirrored flag used by initrd, which will lead to error log printed by find_zone_movable_pfns_for_nodes() if the lower 4G range has some non-mirrored memory. To solve this problem, only MEMBLOCK_NOMAP flag will be removed via memblock_clear_nomap(). Signed-off-by: Ma Wupeng Reviewed-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 339ee84e5a61..8456dbae9441 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -350,8 +350,8 @@ void __init arm64_memblock_init(void) "initrd not fully accessible via the linear mapping -- please check your bootloader ...\n")) { phys_initrd_size = 0; } else { - memblock_remove(base, size); /* clear MEMBLOCK_ flags */ memblock_add(base, size); + memblock_clear_nomap(base, size); memblock_reserve(base, size); } }