Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp423038iog; Mon, 13 Jun 2022 05:43:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoqKvl1b4CAJTR+jl84fZbNRMXiYeQozc9YW60vOhtFzd4em2SgVh1yVqCx7Rr3YxRYVAI X-Received: by 2002:a17:906:b816:b0:708:2e56:97d7 with SMTP id dv22-20020a170906b81600b007082e5697d7mr52181240ejb.502.1655124213630; Mon, 13 Jun 2022 05:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655124213; cv=none; d=google.com; s=arc-20160816; b=0SpQE1+Oi91dDjdHS+uJYTFAwZ4knNAHodL+Xbawehjc22w1IAylEJAgruaFC87aw8 0mw4l8sIgWvJoG5/Um5t/St+zb28hG2kskCikMWIOZzH6Ouy63850vgv4IZMybghS04u bIVhpaRPVcUGm8u62fxCNWsLe0h+bQUFFH3BkllgAG4kQUNfiQSOTvl3Xsx8ZLp25nJv 7slvrEr/mSfS8g4U8KOKIMkH5zIsWh7ZXiRRiPN3PU4CYIsAmH9Wla803WTefaG9PISq +qC8aNqnT4+WQ6Rm9yzGO8j95l7EuE3TbcDmIdc9RDvEAM0hB/uf0j0rCo59SA1LQ8W+ OVGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c48UIdgEHwyzFxVEb8Yw/gBuie1hAX7ZdNx4G0OSOXM=; b=Bk71dVa9nMzP/NqtNByVU6MFX/Sgpl1C9xr0jc9sOQEdBIsY9LPcq6QYvQdkF6to6Z fDdsmaUPQnVkspP0SHw4KRbMe47QiuIEbRPXppZ/GFTw78EK9sPAyhF3UVEjn22Fqno+ fNN6VlEPHVFEXOJhb2GEUOAvJm5SZO/R0c+mP/chB5EVl4s8trjySKXpb43Pye3JT5dA HJntj1zJEDkqzTD5PhX8XGuXhObYrcIUcORFIHcpv9dYQ3dz43v0MgXEconMHqZe+JSc fq09ljSOGKzuKTsDvoMDsuKzJ3zrIUSOtRTE988oLB3OTRVykoTPPT5PpwRF6FWPhpVd Q3Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tsoF5PUg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga19-20020a1709070c1300b0071257a7e8bbsi9153008ejc.607.2022.06.13.05.43.05; Mon, 13 Jun 2022 05:43:33 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tsoF5PUg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240968AbiFMJnM (ORCPT + 99 others); Mon, 13 Jun 2022 05:43:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239350AbiFMJnJ (ORCPT ); Mon, 13 Jun 2022 05:43:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06D61FD3E; Mon, 13 Jun 2022 02:43:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9765B61381; Mon, 13 Jun 2022 09:43:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 049FEC34114; Mon, 13 Jun 2022 09:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655113388; bh=ulBYdazc2wFX860EwjmZxCF5MO+a9+ET23gEIOuI9uU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tsoF5PUgEdm+pCcqk1wEO/j63pF1rIMskWsdXvKiw9oelaPCL63JkGSUZBVCW+Up8 OdU4GgnikAs86gCW772iq2GdT/k7Lw+tK0SF9qk5BpHuIEaEFUzwMfJZkEeMuabWWC 23ktv6pcWgBceNYn0HIZowp9HjxC3oKlMAX9/XsQ1JxxQXpaOZ4Yxdc/d8yBv+Flew vBwy+eYVEmw4iXocJ6jhRQd+xEfLUKwyl2ToUDONmUKCOX4odS9gvX9y1u0vN7Lr9F F28Txo+thuVrxRbkDkQXaIUYDC+KI6tPhQhBsX1pIERKoIU28SNqeSzj+8kzUA1+32 kWU82zQ+k1m+w== Received: by mail-yb1-f173.google.com with SMTP id r82so8886411ybc.13; Mon, 13 Jun 2022 02:43:07 -0700 (PDT) X-Gm-Message-State: AOAM533GFsvjR/HbyF8YhyZkTVf7bUMyMmW4NfAD5z74g2rmb8oS4IMZ FMedLNfA44MMaUE2fod0jAUZtC1Ax2Pnn9FXUlo= X-Received: by 2002:a05:6820:1501:b0:41b:d535:325c with SMTP id ay1-20020a056820150100b0041bd535325cmr5522819oob.60.1655113376804; Mon, 13 Jun 2022 02:42:56 -0700 (PDT) MIME-Version: 1.0 References: <20220613082147.183145-1-mawupeng1@huawei.com> <20220613082147.183145-6-mawupeng1@huawei.com> In-Reply-To: <20220613082147.183145-6-mawupeng1@huawei.com> From: Ard Biesheuvel Date: Mon, 13 Jun 2022 11:42:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 5/6] mm: Only remove nomap flag for initrd To: Wupeng Ma , Will Deacon , Catalin Marinas Cc: Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , "H. Peter Anvin" , Darren Hart , Andy Shevchenko , Mike Rapoport , Andrew Morton , Paul Walmsley , palmer@dabbelt.com, aou@eecs.berkeley.edu, paulmck@kernel.org, keescook@chromium.org, songmuchun@bytedance.com, rdunlap@infradead.org, damien.lemoal@opensource.wdc.com, swboyd@chromium.org, wei.liu@kernel.org, robin.murphy@arm.com, david@redhat.com, anshuman.khandual@arm.com, thunder.leizhen@huawei.com, wangkefeng.wang@huawei.com, gpiccoli@igalia.com, chenhuacai@kernel.org, geert@linux-m68k.org, vijayb@linux.microsoft.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Mon, 13 Jun 2022 at 10:00, Wupeng Ma wrote: > > 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 This needs and ack from the arm64 maintainers, please? And also please fix the subject to include 'arm64' > --- > 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 >