aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2016-08-02 17:05:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:25 -0400
commit966fab00b0e19e0db3cb11d81bda5d0940176d5e (patch)
treea3bf0aa17cd337e0c521b764454f4ed616a1cbb6
parentf7f0b7dc720f81b53afffb6779437086cdc3f62d (diff)
ARM: kexec: advertise location of bootable RAM
Advertise the location of bootable RAM to kexec-tools. kexec needs to know where it can place the kernel in RAM, and so be executable when the system needs to jump into it. Advertise these areas in /proc/iomem with a "System RAM (boot alias)" tag. Link: http://lkml.kernel.org/r/E1b8ko4-0004HA-GF@rmk-PC.armlinux.org.uk Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Pratyush Anand <panand@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Keerthy <j-keerthy@ti.com> Cc: Vitaly Andrianov <vitalya@ti.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Dave Young <dyoung@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Simon Horman <horms@verge.net.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arm/kernel/setup.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 6c8c888c1152..df7f2a75e769 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -848,10 +848,29 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
848 kernel_data.end = virt_to_phys(_end - 1); 848 kernel_data.end = virt_to_phys(_end - 1);
849 849
850 for_each_memblock(memory, region) { 850 for_each_memblock(memory, region) {
851 phys_addr_t start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
852 phys_addr_t end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
853 unsigned long boot_alias_start;
854
855 /*
856 * Some systems have a special memory alias which is only
857 * used for booting. We need to advertise this region to
858 * kexec-tools so they know where bootable RAM is located.
859 */
860 boot_alias_start = phys_to_idmap(start);
861 if (arm_has_idmap_alias() && boot_alias_start != IDMAP_INVALID_ADDR) {
862 res = memblock_virt_alloc(sizeof(*res), 0);
863 res->name = "System RAM (boot alias)";
864 res->start = boot_alias_start;
865 res->end = phys_to_idmap(end);
866 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
867 request_resource(&iomem_resource, res);
868 }
869
851 res = memblock_virt_alloc(sizeof(*res), 0); 870 res = memblock_virt_alloc(sizeof(*res), 0);
852 res->name = "System RAM"; 871 res->name = "System RAM";
853 res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); 872 res->start = start;
854 res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; 873 res->end = end;
855 res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; 874 res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
856 875
857 request_resource(&iomem_resource, res); 876 request_resource(&iomem_resource, res);