diff options
author | Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> | 2013-02-12 16:17:37 +0530 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-03-05 11:11:07 +0900 |
commit | 0d4ff47c810bd13b1160fade55a803706021840c (patch) | |
tree | a6f4f560d3b607d7b42fddac6ccf2a800980db5c /kexec/arch/ppc64/crashdump-ppc64.c | |
parent | a69f5b5a432fc0abf6655a8b0bc667a900511f7d (diff) |
kexec: Respect memory limit while building crash memory ranges on ppc64
Fix it on ppc64 also. This patch now reads the memory limit information
from device-tree file and limits the crash memory ranges accordingly.
Tested this patch on ppc64 with upstream kernel version 3.8.0-rc4
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/ppc64/crashdump-ppc64.c')
-rw-r--r-- | kexec/arch/ppc64/crashdump-ppc64.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c index 30ef443..b8a63bd 100644 --- a/kexec/arch/ppc64/crashdump-ppc64.c +++ b/kexec/arch/ppc64/crashdump-ppc64.c @@ -84,10 +84,19 @@ static unsigned long long cstart, cend; static int memory_ranges; /* - * Exclude the region that lies within crashkernel + * Exclude the region that lies within crashkernel and above the memory + * limit which is reflected by mem= kernel option. */ static void exclude_crash_region(uint64_t start, uint64_t end) { + /* If memory_limit is set then exclude the memory region above it. */ + if (memory_limit) { + if (start >= memory_limit) + return; + if (end > memory_limit) + end = memory_limit; + } + if (cstart < end && cend > start) { if (start < cstart && end > cend) { crash_memory_range[memory_ranges].start = start; |