Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp229236iog; Mon, 13 Jun 2022 01:03:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUbnVM60E8UrfJXai+jA6RRM3xx1BujYEeuFKg/DMWPoOWNzJVnFe4ho2nGO+xTWwJrFa6 X-Received: by 2002:a63:305:0:b0:3fc:7f18:8d7 with SMTP id 5-20020a630305000000b003fc7f1808d7mr50320566pgd.186.1655107387269; Mon, 13 Jun 2022 01:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655107387; cv=none; d=google.com; s=arc-20160816; b=iGKLgUlmc/jh6LCjbUN6qFsrQvwlYGqLLm1n7J6phtBsimrBcRLtFGkZWV3fXotJjo ENTKDpjQjXILyiRAm+Yqz0DZPEZAeQm1CZyZVLEHAbpPtVYJupX2Had6T4ZcrGBhWKgv egN4CKDZrfHE/APucXAhM9jTQv9P/C2eINJ1ISYzf/PznmxqLcI2x8B/nRncvOyjcPbB cNnjgRvGvfohXDIMg4vF1/fjiOVsKES6sdHccvYRxP35cN4aJlndXvbLxh3Du5OKRY6s ZM6g9KfnqY0IyYgjNlgURe2akvJgPB2WHpMMgr6a6dFZlEhSvlh3qdy2ST0BPeQwVZVT Te7A== 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; bh=Se1demI1MX5YtxTqEdtfIVdZi3E63hDR24tM/0+YpCM=; b=b5Py/DiaN3xNemn4bFCFELEINNOLd3ZOi/gBlFr+qco7uB/q7amlfOno8z0dVHw4iU tLHL76FWP8r2hl7Wau992YJtj4gKVSemAXpPtzhu4bGzvSI1WuIGPQNts2cJS7oLLEfZ f7rqu/p6EgRfo+OwX+UfOzXEFhJzP0W9m9vcK26Zg9Tu5eTFfc/tf+Xfvu5vdKkDhb2W Ca/OsZEydFrVRIC1N2IylYVfQCxUp7XXs/Q8pxzNqDaw6+QR2ZjUNx1Y7q3EkRDI/AJd n0Y7JIgKGjlWAK8vKDssCO32FYOddwWlMnHNKOPd8e4qfwY4ZOK4H9Yxc0AxXU5YENqk XsOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jb22-20020a170903259600b0015eabaaa16fsi8841444plb.578.2022.06.13.01.02.53; Mon, 13 Jun 2022 01:03:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239414AbiFMIAt (ORCPT + 99 others); Mon, 13 Jun 2022 04:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbiFMIAg (ORCPT ); Mon, 13 Jun 2022 04:00:36 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8CF1141; Mon, 13 Jun 2022 01:00:35 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LM3qY4rMyzjXbr; Mon, 13 Jun 2022 15:59:05 +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; Mon, 13 Jun 2022 16:00:33 +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; Mon, 13 Jun 2022 16:00:31 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 5/6] mm: Only remove nomap flag for initrd Date: Mon, 13 Jun 2022 16:21:46 +0800 Message-ID: <20220613082147.183145-6-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220613082147.183145-1-mawupeng1@huawei.com> References: <20220613082147.183145-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); } } -- 2.25.1