From mboxrd@z Thu Jan 1 00:00:00 1970 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 751F2C433EF for ; Tue, 11 Jan 2022 19:10:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 913D26B00B6; Tue, 11 Jan 2022 14:10:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 89B776B00B7; Tue, 11 Jan 2022 14:10:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73C196B00B8; Tue, 11 Jan 2022 14:10:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id 5C8956B00B6 for ; Tue, 11 Jan 2022 14:10:48 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1A02595272 for ; Tue, 11 Jan 2022 19:10:48 +0000 (UTC) X-FDA: 79018948176.09.93BDD6C Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf12.hostedemail.com (Postfix) with ESMTP id 0240B4000B for ; Tue, 11 Jan 2022 19:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641928247; x=1673464247; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=guB/DjhT2AMQhK/vQUIlG64RQu1W/DQlUEBykbhTvTk=; b=Hsl/i/bIzfQRc9tikVZBwxQXuV4eGZDhpc/QEPETKWZvou6PLvpXaEzz pWhlCpEh7guPwVqUFIql3iHqhTGRfmZVRK/KlJaRdLlFzjnkLERmZq2zS ne70uDio82qF8hqcOENJeGoVWw9fLiANet2Db6/n7f+1iUA8Br/vns0ap E6KSUUuZFvDkYKOa6yJRe4AuZ58mzI1bx+1qiaYsKwfeVeG9Mmt8Dx1CU 7yT4uHZ5kwlnGNNYHNMreUQctvWg5qwRIosoIdloEhBmEYljelBsTK4FT jO3K3A8ihndeJnvxdsvGdTUKVJ0yeEOr/GYF09z8C0zo7/crwDzOHh52V g==; X-IronPort-AV: E=McAfee;i="6200,9189,10224"; a="243519459" X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="243519459" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 11:10:45 -0800 X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="613315060" Received: from padhika1-mobl.amr.corp.intel.com (HELO [10.209.13.65]) ([10.209.13.65]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 11:10:44 -0800 Message-ID: <3a361a1d-0e14-8884-c5bb-90aeb87e38ef@intel.com> Date: Tue, 11 Jan 2022 11:10:40 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCHv2 5/7] x86/mm: Reserve unaccepted memory bitmap Content-Language: en-US To: "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel Cc: Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220111113314.27173-1-kirill.shutemov@linux.intel.com> <20220111113314.27173-6-kirill.shutemov@linux.intel.com> From: Dave Hansen In-Reply-To: <20220111113314.27173-6-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0240B4000B X-Stat-Signature: cgsa7f57xu81usg4huquacja7h49a3h3 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="Hsl/i/bI"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf12.hostedemail.com: domain of dave.hansen@intel.com has no SPF policy when checking 134.134.136.65) smtp.mailfrom=dave.hansen@intel.com X-Rspamd-Server: rspam06 X-HE-Tag: 1641928246-400942 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: On 1/11/22 03:33, Kirill A. Shutemov wrote: > Unaccepted memory bitmap is allocated during decompression stage and > handed over to main kernel image via boot_params. The bitmap is used to > track if memory has been accepted. > > Reserve unaccepted memory bitmap has to prevent reallocating memory for > other means. I'm having a hard time parsing that changelog, especially the second paragraph. Could you give it another shot? > + /* Mark unaccepted memory bitmap reserved */ > + if (boot_params.unaccepted_memory) { > + unsigned long size; > + > + /* One bit per 2MB */ > + size = DIV_ROUND_UP(e820__end_of_ram_pfn() * PAGE_SIZE, > + PMD_SIZE * BITS_PER_BYTE); > + memblock_reserve(boot_params.unaccepted_memory, size); > + } Is it OK that the size of the bitmap is inferred from e820__end_of_ram_pfn()? Is this OK in the presence of mem= and other things that muck with the e820?