crash_core: fix the check for whether crashkernel is from high memory
authorYuntao Wang <ytcoode@gmail.com>
Sat, 9 Dec 2023 14:14:38 +0000 (22:14 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 13 Dec 2023 01:20:18 +0000 (17:20 -0800)
commit1dd11e977360ad3493812da0b05ffd9adcdd15a1
tree3a51fe456752e1147c72d447ea58a81d09578c56
parent69f8ca8d36b5e52360f45c3b63bcb3d075da36df
crash_core: fix the check for whether crashkernel is from high memory

If crash_base is equal to CRASH_ADDR_LOW_MAX, it also indicates that
the crashkernel memory is allocated from high memory. However, the
current check only considers the case where crash_base is greater than
CRASH_ADDR_LOW_MAX. Fix it.

The runtime effects is that crashkernel high memory is successfully
reserved, whereas the crashkernel low memory is bypassed in this case,
then kdump kernel bootup will fail because of no low memory under 4G.

This patch also includes some minor cleanups.

Link: https://lkml.kernel.org/r/20231209141438.77233-1-ytcoode@gmail.com
Fixes: 0ab97169aa05 ("crash_core: add generic function to do reservation")
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/crash_core.c