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 X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C122C2D0EC for ; Thu, 26 Mar 2020 18:08:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0956820722 for ; Thu, 26 Mar 2020 18:08:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0956820722 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 AB57B6B0036; Thu, 26 Mar 2020 14:08:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A661F6B0037; Thu, 26 Mar 2020 14:08:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97DD06B006C; Thu, 26 Mar 2020 14:08:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 7FE806B0036 for ; Thu, 26 Mar 2020 14:08:32 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B0FF6180AE1BA for ; Thu, 26 Mar 2020 18:08:32 +0000 (UTC) X-FDA: 76638298464.25.stone69_105e1c4db5737 X-HE-Tag: stone69_105e1c4db5737 X-Filterd-Recvd-Size: 3020 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Mar 2020 18:08:32 +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 3C45C7FA; Thu, 26 Mar 2020 11:08:31 -0700 (PDT) Received: from melchizedek.cambridge.arm.com (melchizedek.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E19AB3F71E; Thu, 26 Mar 2020 11:08:29 -0700 (PDT) From: James Morse To: kexec@lists.infradead.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Cc: Eric Biederman , Andrew Morton , Catalin Marinas , Will Deacon , Anshuman Khandual , Bhupesh Sharma , James Morse Subject: [PATCH 2/3] mm/memory_hotplug: Allow arch override of non boot memory resource names Date: Thu, 26 Mar 2020 18:07:29 +0000 Message-Id: <20200326180730.4754-3-james.morse@arm.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200326180730.4754-1-james.morse@arm.com> References: <20200326180730.4754-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: Memory added to the system by hotplug has a 'System RAM' resource created for it. This is exposed to user-space via /proc/iomem. This poses problems for kexec on arm64. If kexec decides to place the kernel in one of these newly onlined regions, the new kernel will find itself booting from a region not described as memory in the firmware tables. Arm64 doesn't have a structure like the e820 memory map that can be re-written when memory is brought online. Instead arm64 uses the UEFI memory map, or the memory node from the DT, sometimes both. We never rewrite these. Allow an architecture to specify a different name for these hotplug regions. Signed-off-by: James Morse --- mm/memory_hotplug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0a54ffac8c68..69b03dd7fc74 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -42,6 +42,10 @@ #include "internal.h" #include "shuffle.h" =20 +#ifndef MEMORY_HOTPLUG_RES_NAME +#define MEMORY_HOTPLUG_RES_NAME "System RAM" +#endif + /* * online_page_callback contains pointer to current page onlining functi= on. * Initially it is generic_online_page(). If it is required it could be @@ -103,7 +107,7 @@ static struct resource *register_memory_resource(u64 = start, u64 size) { struct resource *res; unsigned long flags =3D IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; - char *resource_name =3D "System RAM"; + char *resource_name =3D MEMORY_HOTPLUG_RES_NAME; =20 if (start + size > max_mem_size) return ERR_PTR(-E2BIG); --=20 2.25.1 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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D119FC43331 for ; Thu, 26 Mar 2020 18:10:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CA6D20714 for ; Thu, 26 Mar 2020 18:10:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nkYqGvcx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CA6D20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z5IVvGJ/cbxehncqjdt5N/SXoEKk/mlY1dSLjIqxS58=; b=nkYqGvcxXNz8xe OiaruXJXG2kQVphLeYjmR0jUod/ESv0XA/q0Cpk2ZefmzHJ9iVrEwkatl4/6HZnaamBJAKBlsIlBM 13ibCmYHu7t3CvXvizjcTBqrhDHTmVEyWkLC4Mq5nuoVK8lGO2+XmEDEgzKRYbpGwGcJBNlk5k9B9 ddOD9O801FoEzc6q+0i/ZMdNgD/cxM/hyLETPKfil9GRHIyduaLMN+wBdIuF+W+7imMVVDFVvE5Ay 6Ax0FK9HhxehEVeeIEQZGuzZgX6aHDq7qisS2Q/kKKhTehHwxw5NblOocSnwBNIHfrMRpEnz9swFJ yZpNJTL1yLVHpUQXPuFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHWxh-0001Mw-WA; Thu, 26 Mar 2020 18:10:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHWvg-00076h-7z; Thu, 26 Mar 2020 18:08:45 +0000 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 3C45C7FA; Thu, 26 Mar 2020 11:08:31 -0700 (PDT) Received: from melchizedek.cambridge.arm.com (melchizedek.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E19AB3F71E; Thu, 26 Mar 2020 11:08:29 -0700 (PDT) From: James Morse To: kexec@lists.infradead.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] mm/memory_hotplug: Allow arch override of non boot memory resource names Date: Thu, 26 Mar 2020 18:07:29 +0000 Message-Id: <20200326180730.4754-3-james.morse@arm.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200326180730.4754-1-james.morse@arm.com> References: <20200326180730.4754-1-james.morse@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200326_110832_347102_8B5576E6 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anshuman Khandual , Catalin Marinas , Bhupesh Sharma , James Morse , Eric Biederman , Andrew Morton , Will Deacon Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Memory added to the system by hotplug has a 'System RAM' resource created for it. This is exposed to user-space via /proc/iomem. This poses problems for kexec on arm64. If kexec decides to place the kernel in one of these newly onlined regions, the new kernel will find itself booting from a region not described as memory in the firmware tables. Arm64 doesn't have a structure like the e820 memory map that can be re-written when memory is brought online. Instead arm64 uses the UEFI memory map, or the memory node from the DT, sometimes both. We never rewrite these. Allow an architecture to specify a different name for these hotplug regions. Signed-off-by: James Morse --- mm/memory_hotplug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0a54ffac8c68..69b03dd7fc74 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -42,6 +42,10 @@ #include "internal.h" #include "shuffle.h" +#ifndef MEMORY_HOTPLUG_RES_NAME +#define MEMORY_HOTPLUG_RES_NAME "System RAM" +#endif + /* * online_page_callback contains pointer to current page onlining function. * Initially it is generic_online_page(). If it is required it could be @@ -103,7 +107,7 @@ static struct resource *register_memory_resource(u64 start, u64 size) { struct resource *res; unsigned long flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; - char *resource_name = "System RAM"; + char *resource_name = MEMORY_HOTPLUG_RES_NAME; if (start + size > max_mem_size) return ERR_PTR(-E2BIG); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel