diff options
author | Vivek Goyal <vgolal@in.ibm.com> | 2006-07-27 11:20:24 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2006-07-27 11:20:24 -0600 |
commit | 0a196ba1d11b449420b7817a84178a8bd2a1e9a5 (patch) | |
tree | 51b730747c591f93bde015de9d53b27d5debb1e5 /kexec/kexec.c | |
parent | 742b147db61c45cc00db63eea7b23d0a462e56c8 (diff) |
Fix kexec load for more than 4G
o "kexec -l bzImage" fails on i386 system with more than 4G of RAM. Error
message displayed is "Could not put setup code above the kernel parameters".
o Now with 64bit resource patch, memory more than 4G is exported through
/proc/iomem. locate_hole() is using local varibles of size unsigned long
and that truncates memory values at some placed and leads to undesired
results.
o hole_align is also unsigned long and which ends up resetting top 32 bits
of 64bit memory start field while alignment operation is done.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r-- | kexec/kexec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c index d6cca88..8b8086f 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -194,8 +194,8 @@ unsigned long locate_hole(struct kexec_info *info, /* Perform a merge on the 2 sorted lists of memory ranges */ for (j = 0, i = 0; i < memory_ranges; i++) { - unsigned long sstart, send; - unsigned long mstart, mend; + unsigned long long sstart, send; + unsigned long long mstart, mend; mstart = memory_range[i].start; mend = memory_range[i].end; if (memory_range[i].type != RANGE_RAM) @@ -233,7 +233,7 @@ unsigned long locate_hole(struct kexec_info *info, if (start < hole_min) { start = hole_min; } - start = (start + hole_align - 1) & ~(hole_align - 1); + start = (start + hole_align - 1) & ~((unsigned long long)hole_align - 1); if (end > mem_max) { end = mem_max; } @@ -251,7 +251,7 @@ unsigned long locate_hole(struct kexec_info *info, hole_base = start; break; } else { - hole_base = (end - hole_size) & ~(hole_align - 1); + hole_base = (end - hole_size) & ~((unsigned long long)hole_align - 1); } } } |