diff options
author | Thadeu Lima de Souza Cascardo <cascardo@canonical.com> | 2020-03-04 20:27:11 -0300 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2020-04-01 14:30:04 +0200 |
commit | a4afe68d9afaeb219c734e73bc4042ac3aa64836 (patch) | |
tree | e4d4eff4cc0b0b4eb776c655e36caf0a71647749 | |
parent | 2c9f26ed20a791a7df0182ba82e93abb52f5a615 (diff) |
crashdump-ppc64: crashkernel-base and crashkernel-size are big-endian
When reading the device-tree exported crashkernel-base and
crashkernel-size, their values should be converted from big-endian to the
CPU byte order.
These is the output of running kexec --print-ckr-size on a little-endian
ppc64 box.
$ kexec --print-ckr-size
137438953472
$ kexec --print-ckr-size
536870912
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ppc64/crashdump-ppc64.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c index 50e3853..b2787d5 100644 --- a/kexec/arch/ppc64/crashdump-ppc64.c +++ b/kexec/arch/ppc64/crashdump-ppc64.c @@ -612,12 +612,12 @@ int get_crash_kernel_load_range(uint64_t *start, uint64_t *end) unsigned long long value; if (!get_devtree_value(DEVTREE_CRASHKERNEL_BASE, &value)) - *start = value; + *start = be64_to_cpu(value); else return -1; if (!get_devtree_value(DEVTREE_CRASHKERNEL_SIZE, &value)) - *end = *start + value - 1; + *end = *start + be64_to_cpu(value) - 1; else return -1; |