diff options
author | Hari Bathini <hbathini@linux.vnet.ibm.com> | 2017-06-01 20:21:26 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-06-28 06:08:09 +0300 |
commit | eae0dfcc44320c79a05637534d59af4643b2ee7b (patch) | |
tree | 0ba49c4ad13332234ad09dd34f339ac6ed839351 /arch/powerpc/kernel/fadump.c | |
parent | a77af552ccc9d4d54459a39f9e5f7ad307aeb4f9 (diff) | |
download | linux-eae0dfcc44320c79a05637534d59af4643b2ee7b.tar.xz |
powerpc/fadump: avoid holes in boot memory area when fadump is registered
To register fadump, boot memory area - the size of low memory chunk that
is required for a kernel to boot successfully when booted with restricted
memory, is assumed to have no holes. But this memory area is currently
not protected from hot-remove operations. So, fadump could fail to
re-register after a memory hot-remove operation, if memory is removed
from boot memory area. To avoid this, ensure that memory from boot
memory area is not hot-removed when fadump is registered.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Reviewed-by: Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/fadump.c')
-rw-r--r-- | arch/powerpc/kernel/fadump.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 08e00448a355..750bff3b4af3 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -113,6 +113,18 @@ int __init early_init_dt_scan_fw_dump(unsigned long node, return 1; } +/* + * If fadump is registered, check if the memory provided + * falls within boot memory area. + */ +int is_fadump_boot_memory_area(u64 addr, ulong size) +{ + if (!fw_dump.dump_registered) + return 0; + + return (addr + size) > RMA_START && addr <= fw_dump.boot_memory_size; +} + int is_fadump_active(void) { return fw_dump.dump_active; |