From patchwork Fri Jan 10 03:09:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11326545 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDFCC139A for ; Fri, 10 Jan 2020 03:09:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C44AF2073A for ; Fri, 10 Jan 2020 03:09:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C44AF2073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 12F638E0009; Thu, 9 Jan 2020 22:09:07 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0B8F18E0001; Thu, 9 Jan 2020 22:09:07 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE9548E0009; Thu, 9 Jan 2020 22:09:06 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id D7FD18E0001 for ; Thu, 9 Jan 2020 22:09:06 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id A01EB8248D51 for ; Fri, 10 Jan 2020 03:09:06 +0000 (UTC) X-FDA: 76360243092.25.year93_6c92976e41a1f X-Spam-Summary: 2,0,0,02bb81c14fe0b643,d41d8cd98f00b204,anshuman.khandual@arm.com,::linux-kernel@vger.kernel.org:linux-arm-kernel@lists.infradead.org:akpm@linux-foundation.org:catalin.marinas@arm.com:will@kernel.org:mark.rutland@arm.com:david@redhat.com:cai@lca.pw:logang@deltatee.com:cpandya@codeaurora.org:arunks@codeaurora.org:dan.j.williams@intel.com:mgorman@techsingularity.net:osalvador@suse.de:ard.biesheuvel@arm.com:steve.capper@arm.com:broonie@kernel.org:valentin.schneider@arm.com:robin.murphy@arm.com:steven.price@arm.com:suzuki.poulose@arm.com:ira.weiny@intel.com:anshuman.khandual@arm.com:robh+dt@kernel.org:frowand.list@gmail.com:devicetree@vger.kernel.org,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1261:1345:1359:1431:1437:1534:1541:1711:1730:1747:1777:1792:1963:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3872:4250:4321:5007:6261:6742:6743:7514:8603:8634:9010:10004:11026:11658:11914:12043:12048:12297:12438:12555:12895:13069:13311:133 57:14096 X-HE-Tag: year93_6c92976e41a1f X-Filterd-Recvd-Size: 2891 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jan 2020 03:09:05 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2925411D4; Thu, 9 Jan 2020 19:09:05 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.42.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5672B3F703; Thu, 9 Jan 2020 19:08:57 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org Cc: mark.rutland@arm.com, david@redhat.com, cai@lca.pw, logang@deltatee.com, cpandya@codeaurora.org, arunks@codeaurora.org, dan.j.williams@intel.com, mgorman@techsingularity.net, osalvador@suse.de, ard.biesheuvel@arm.com, steve.capper@arm.com, broonie@kernel.org, valentin.schneider@arm.com, Robin.Murphy@arm.com, steven.price@arm.com, suzuki.poulose@arm.com, ira.weiny@intel.com, Anshuman Khandual , Rob Herring , Frank Rowand , devicetree@vger.kernel.org Subject: [PATCH V11 3/5] of/fdt: Mark boot memory with MEMBLOCK_BOOT Date: Fri, 10 Jan 2020 08:39:13 +0530 Message-Id: <1578625755-11792-4-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578625755-11792-1-git-send-email-anshuman.khandual@arm.com> References: <1578625755-11792-1-git-send-email-anshuman.khandual@arm.com> 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: early_init_dt_add_memory_arch() adds memory into memblock on both UEFI and DT based arm64 systems. Lets mark these as boot memory right after they get into memblock. All other platforms using this default implementation for early_init_dt_add_memory_arch() will also have this memblock flag set on boot memory ranges but will be upto the platforms if they would like to use it or not. On arm64 platform this flag will be used to identify boot memory at runtime and reject any attempt to remove them. Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org Signed-off-by: Anshuman Khandual --- drivers/of/fdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 2cdf64d..a2ae2c88 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1143,6 +1143,7 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) base = phys_offset; } memblock_add(base, size); + memblock_mark_boot(base, size); } int __init __weak early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size)