summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2020-04-30 16:17:45 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2020-04-30 16:17:45 +1000
commitf20149bbd3b3a8e58f0486efe96ad0dd2708ea97 (patch)
tree1292d383cf5be63b58ab6552f576c5577c083aa1 /mm
parent2134344031a6b1df3b4de226370f530fb42c42c8 (diff)
mm/memory_hotplug: allow arch override of non boot memory resource names
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. Link: http://lkml.kernel.org/r/20200326180730.4754-3-james.morse@arm.com Signed-off-by: James Morse <james.morse@arm.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Bhupesh Sharma <bhsharma@redhat.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: David Hildenbrand <david@redhat.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Will Deacon <will@kernel.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: piliu <piliu@redhat.com> Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index ad54349a2550..555137bd0882 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
@@ -102,7 +106,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;
/*
* Make sure value parsed from 'mem=' only restricts memory adding