Message ID | 20230507234618.18067-7-kirill.shutemov@linux.intel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 882A0C77B75 for <linux-mm@archiver.kernel.org>; Sun, 7 May 2023 23:46:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 754F96B0088; Sun, 7 May 2023 19:46:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7060C6B0089; Sun, 7 May 2023 19:46:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 509C26B008A; Sun, 7 May 2023 19:46:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3A2DD6B0088 for <linux-mm@kvack.org>; Sun, 7 May 2023 19:46:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 10FB91A0288 for <linux-mm@kvack.org>; Sun, 7 May 2023 23:46:49 +0000 (UTC) X-FDA: 80765096538.28.5DEB69A Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf22.hostedemail.com (Postfix) with ESMTP id E6ACBC0003 for <linux-mm@kvack.org>; Sun, 7 May 2023 23:46:46 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=gMSAfSx8; spf=none (imf22.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683503207; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SxAVKXcnaB18uGCScmaGm0KtqOzQ9BlZ2AI3oJdJlic=; b=vIQ/CNrvDbmkTNxH7nWIEsVFAJiDevhVMd2lwtW5LgLwyOsfPoWYmnlLoByo0MsVgNXAsA yV70S/WR5cS7JVfNYDKUQ8JBSSRzjvHAl4HJ40rS4NgaDcOMbNSQXS03/0vS7RxWvSgoBY Qun3YUO/xpQ2ND8N5pK/QaiAna9Mjhs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683503207; a=rsa-sha256; cv=none; b=N+RvYjTh6C/wSQ5nlkC/Zh3UV00b8+JP4RW8Jnvwk3K3jjXlVM4xEVP/52w/QEITqGV3h9 48LLHS2x9dnEXrdMvbQ5RTkmbblSlQx5Z4xa9+uJtvNlRQwnikGZsR51f4PHDcVr1W8MkJ DlUNCttO3biD5ZmMs0lMGflkxinvvvk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=gMSAfSx8; spf=none (imf22.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683503207; x=1715039207; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XL6vN5u+KeCOGSvPKGIDg51xwwNZ7oq3J9d7SYKdrYE=; b=gMSAfSx8893oi4lAInR0ccjfUNDoZ08LIc1JYC/ulDrKmqr4zNGjoFV4 ol3xrXrrhRoiUT1otSYrN8APA1Ltb7P/plICLhy305gU3JWNsJbPqfYlL CgDTCcxTn3rOWdVcXDzVkuwt9tDyF0zHRjQOY0jphEv8odXNyvr84xpqK SOIvToiBhF5Vz/ioAPGSpaUvhuGx1bRtsAv8LzhZv4b5+dNBOH5HqAKLu Sfkx0r8zBIcju1/51AHrD00bSFIB69aNTwnjOeEDwIY0LatBRdec9NBm0 pwjN7DU+s8wsWKIXvMxhSw5utaK+RtTZaEmYAv5HNChIJBXSUP/zrYNvc A==; X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="349550288" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="349550288" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2023 16:46:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="701222810" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="701222810" Received: from dancaspi-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.61.73]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2023 16:46:32 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 47A4610D334; Mon, 8 May 2023 02:46:20 +0300 (+03) From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> To: Borislav Petkov <bp@alien8.de>, Andy Lutomirski <luto@kernel.org>, Dave Hansen <dave.hansen@intel.com>, Sean Christopherson <seanjc@google.com>, Andrew Morton <akpm@linux-foundation.org>, Joerg Roedel <jroedel@suse.de>, Ard Biesheuvel <ardb@kernel.org> Cc: Andi Kleen <ak@linux.intel.com>, Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>, David Rientjes <rientjes@google.com>, Vlastimil Babka <vbabka@suse.cz>, Tom Lendacky <thomas.lendacky@amd.com>, Thomas Gleixner <tglx@linutronix.de>, Peter Zijlstra <peterz@infradead.org>, Paolo Bonzini <pbonzini@redhat.com>, Ingo Molnar <mingo@redhat.com>, Dario Faggioli <dfaggioli@suse.com>, Mike Rapoport <rppt@kernel.org>, David Hildenbrand <david@redhat.com>, Mel Gorman <mgorman@techsingularity.net>, marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Mike Rapoport <rppt@linux.ibm.com> Subject: [PATCHv10 06/11] x86/mm: Reserve unaccepted memory bitmap Date: Mon, 8 May 2023 02:46:13 +0300 Message-Id: <20230507234618.18067-7-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230507234618.18067-1-kirill.shutemov@linux.intel.com> References: <20230507234618.18067-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6ACBC0003 X-Stat-Signature: iinqjm333uznksa1x8w18fpwm5anwrkg X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1683503206-922130 X-HE-Meta: U2FsdGVkX18YJAjvycaADX/g0x4JuR8XFZy42gfD5ljbPN1f/dYhk+42MUsJoQbEUFFKVIdBvgayAMHGD0fhRtYjjNNWtz+QMqXfRnxwEYBwETFWd/m0yEVTUTFUMT83SpCkBJTTyJVqz4CLigd1NK0zi1r1yk6ojId/aFlIvQcE4LX6y5xZ9/GLCCir7fFPytgg49nAdHmIVW8Xjxi6f1VpUFqcR+LCALB0BZrExpCaDEwEciu1X1KcNRcV2D5xndJooz+bU2vidYH/bytI6vUCEXKvN5z5G4E1CBZ6yrzhlYsPswLTW1AHMiXcT3vJCpyabIaRmPmrwBmYtTgXap/hY+1AtT2AugyKVKEGtB1sWC2NP1v7VUs604X4oKGmSHvqlbcjVP4j7IC6417Msth6hWMC4PKziKl+x5OGgwwOMhHmJGVDR97HSqeriRWmOc9suBrrFIJbDuZ+W3L9fxSyYxdYIZGx3/TUHR9hMod5iUC+yYTdhZcHhf4BIDlwmb+4QvOpREmlD32i1RPfPCxsKeqXm1DT/o+ZgcJCN7CuVOA376iVrAhILa5ugGY39I4cRlIi2ly63zq67tr537OrVDg6Wz/daoEo67aS8mxSxp3QdN8/pEnXY7T8duch5VSwtjTiqiEQw2sYpHD7E/FFppFyenl/hAeDHxMEZDE250AYAJAZ9SWBWAUH/Fuay5cCVqlaEObkI4hDQDbNZpn23wpmnuKHUh6donlIGEz3R0x1xCOBUzWo7NkuAKott0ZI4wzMtpeK7ZX/F1crhS5HDJXyAK+4ALTHD1d8N1Kmzf0d4lVVkvmdW0qiitI3cipxdBTH72gg7Wr/OojVo7KHpX/9MjTiTbJFjW3VtUuKmwMPjfSgeG/hXMSypj8+cJ8rrabGfEyoup1pUOgqYL5+dKLzVBzaxaNIWDDIPew6lXZI+idW/ivaM6gBp5Q4cwnBqzKP6ly1dLExx6U frIZ2s0y /3GwYkJFDuxT7xN+T8y0NcaiVP5PvwziTHk59QRn2b0WBshhUAIEpa18qvV28gPC7Ux5AUHtsKeCtWVQnYiLusbM7eVG292gi6BLYMxvN/xmNgqosV2RmphP0rcroKVbW46YVQXeGZMnCvm26INuBfmFHO0Gt0vn4Tjtj 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: <linux-mm.kvack.org> |
Series |
mm, x86/cc: Implement support for unaccepted memory
|
expand
|
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index fb8cf953380d..483c36a28d2e 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -1316,6 +1316,23 @@ void __init e820__memblock_setup(void) int i; u64 end; + /* + * Mark unaccepted memory bitmap reserved. + * + * This kind of reservation usually done from early_reserve_memory(), + * but early_reserve_memory() called before e820__memory_setup(), so + * e820_table is not finalized and e820__end_of_ram_pfn() cannot be + * used to get correct RAM size. + */ + 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); + } + /* * The bootstrap memblock region count maximum is 128 entries * (INIT_MEMBLOCK_REGIONS), but EFI might pass us more E820 entries