Commit f736104f authored by AKASHI Takahiro's avatar AKASHI Takahiro Committed by Simon Horman
Browse files

arm64: kexec: allocate memory space avoiding reserved regions



On UEFI/ACPI-only system, some memory regions, including but not limited
to UEFI memory map and ACPI tables, must be preserved across kexec'ing.
Otherwise, they can be corrupted and result in early failure in booting
a new kernel.

In recent kernels, /proc/iomem now has an extended file format like:

 40000000-5871ffff : System RAM
   41800000-426affff : Kernel code
   426b0000-42aaffff : reserved
   42ab0000-42c64fff : Kernel data
   54400000-583fffff : Crash kernel
   58590000-585effff : reserved
   58700000-5871ffff : reserved
 58720000-58b5ffff : reserved
 58b60000-5be3ffff : System RAM
   58b61000-58b61fff : reserved

where the "reserved" entries at the top level or under System RAM (and
its descendant resources) are ones of such kind and should not be regarded
as usable memory ranges where several free spaces for loading kexec data
will be allocated.

With this patch, get_memory_ranges() will handle this format of file
correctly. Note that, for safety, unknown regions, in addition to
"reserved" ones, will also be excluded.

Signed-off-by: default avatarAKASHI Takahiro <takahiro.akashi@linaro.org>
Tested-by: default avatarBhupesh Sharma <bhsharma@redhat.com>
Tested-by: default avatarMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent cf977b1a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment