From a4afe68d9afaeb219c734e73bc4042ac3aa64836 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Wed, 4 Mar 2020 20:27:11 -0300 Subject: 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 Signed-off-by: Simon Horman --- kexec/arch/ppc64/crashdump-ppc64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c index 50e3853d..b2787d51 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; -- cgit 1.2.3-korg