Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1490687pxb; Thu, 4 Mar 2021 12:44:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOzK/j34ZFF1v4S0zPrbeDp2VuAIVZH7wh0VtWzh5Ttc0dM+FjSXeo3QOTHHjVp7x+e7t1 X-Received: by 2002:aa7:c450:: with SMTP id n16mr6309848edr.16.1614890640243; Thu, 04 Mar 2021 12:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614890640; cv=none; d=google.com; s=arc-20160816; b=IDE2qFDHcHmppgO4LsWddP02itIDk06ydko78xfC1iWMgVyfS1Vc4e68BSX2oUBaZP e7XHB8E0crD1CjcD0kA9/CFOFZHATyIPaMkaY5bnGJ20FtCE3BvD8BX16Tc5Q7oEx9si S/kDEO0xfXfdl1F7z6+KDRAjf0VLnVeh9U2dtsD2F402+tgd5L2ZUl9H8k8uqlDAiwDp 7rXo/HLv89RcGaSOEbW54mbEZWXyWmK/4jQBSGUXx4Wzwv9hcvlrR/2m/0E8pEEsPCAn aKSzbrV2oqzHg1EwguD+i+KcXFiOBcecbwdOhNSKa4IqRzvPrwmRPmWTjP0nGtW2jbHb yv8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=eJ8fhS+O4Rb8GZGJYkmyko8OHt98hIay+OTIrXCbPnE=; b=HSIVWOZ6LfTlIdIgORC4KbqKvR/xwi3GpQEbsIDh7/keEgA7UhueI5ZgAiDpxZfeI3 w133RMb6Mr7KDsk/MnplgcYvaBYfJ3nZn6GWmoHYFPdNSAOY4c/Omx1soX0cnmW01ShU s8oYlYByLIK2jyfjnlpbMyjIxZodNm7WjmfX7tD8G0iIXABUPZkBrprL+veT1eMkoPzu D1KGbSYwRhLTjuhcyw1KII1kCgtDsEyJbuH/jH3TS3g9V3EMBluf7XjpByXVh0HgIo1o NbhJGac4FiGh0uG2s0VwfeykGFxh8MYUEGJAHMGwQ9JN0+SaqplfaQR4lJ3cJe7gJ3QC b+tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Czt/YkzA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si113494ejg.257.2021.03.04.12.43.32; Thu, 04 Mar 2021 12:44:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Czt/YkzA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345561AbhCCK7e (ORCPT + 99 others); Wed, 3 Mar 2021 05:59:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28333 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240936AbhCCAll (ORCPT ); Tue, 2 Mar 2021 19:41:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614732014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eJ8fhS+O4Rb8GZGJYkmyko8OHt98hIay+OTIrXCbPnE=; b=Czt/YkzAempczxZYUXyqpdOb/8vFsWulT/OiUna3FOvVX6MtZbtZTT0YPwOwL/r8KozBDY 8qYQKhbyJKFZLBq4x6sOTuvnlFFQ2SFtqAydDcJt4aOYxt/XjXMxuR3fG5jhpKS3mRZW1Q y4HBxjiiPg2SmjKbvIi3SMcbbbSgOMw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-17-ruB1zOTSNRy5GP62OfiObw-1; Tue, 02 Mar 2021 19:40:10 -0500 X-MC-Unique: ruB1zOTSNRy5GP62OfiObw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7A35803F47; Wed, 3 Mar 2021 00:40:07 +0000 (UTC) Received: from localhost (ovpn-12-93.pek2.redhat.com [10.72.12.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C12FB6FEE2; Wed, 3 Mar 2021 00:40:01 +0000 (UTC) Date: Wed, 3 Mar 2021 08:39:59 +0800 From: Baoquan He To: Mike Rapoport Cc: x86@kernel.org, Andrew Morton , Andrea Arcangeli , Borislav Petkov , David Hildenbrand , "H. Peter Anvin" , Ingo Molnar , Mel Gorman , Michal Hocko , Mike Rapoport , Qian Cai , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Borislav Petkov Subject: Re: [PATCH v3 1/2] x86/setup: consolidate early memory reservations Message-ID: <20210303003959.GB2962@MiWiFi-R3L-srv> References: <20210302100406.22059-1-rppt@kernel.org> <20210302100406.22059-2-rppt@kernel.org> <20210302130409.GA2962@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/21 at 05:17pm, Mike Rapoport wrote: > On Tue, Mar 02, 2021 at 09:04:09PM +0800, Baoquan He wrote: ... > > > +static void __init early_reserve_memory(void) > > > +{ > > > + /* > > > + * Reserve the memory occupied by the kernel between _text and > > > + * __end_of_kernel_reserve symbols. Any kernel sections after the > > > + * __end_of_kernel_reserve symbol must be explicitly reserved with a > > > + * separate memblock_reserve() or they will be discarded. > > > + */ > > > + memblock_reserve(__pa_symbol(_text), > > > + (unsigned long)__end_of_kernel_reserve - (unsigned long)_text); > > > + > > > + /* > > > + * Make sure page 0 is always reserved because on systems with > > > + * L1TF its contents can be leaked to user processes. > > > + */ > > > + memblock_reserve(0, PAGE_SIZE); > > > + > > > + early_reserve_initrd(); > > > + > > > + if (efi_enabled(EFI_BOOT)) > > > + efi_memblock_x86_reserve_range(); > > > + > > > + memblock_x86_reserve_range_setup_data(); > > > > This patch looks good to me, thanks for the effort. > > > > While at it, wondering if we can rename the above function to > > memblock_reserve_setup_data() just as its e820 counterpart > > e820__reserve_setup_data(), adding 'x86' to a function under arch/x86 > > seems redundant. > > I'd rather keep these names for now. First, it's easier to dig to them in the git > history and second, I'm planning more changes in this area and these names > are as good as FIXME: to remind what still needs to be checked :) I see, thanks for explanation.