From 8f32a60c221e041777c9b1d24f864cb1226432ca Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Thu, 24 Jun 2021 06:42:51 +0200 Subject: [PATCH] zipl: Use util_arch_hsa_maxsize() to compute address limit for kdump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HSA size, which limits the address space in kdump case, is not constant and depends on the underlying architecture. Signed-off-by: Alexander Egorenkov Reviewed-by: Jan Höppner Signed-off-by: Jan Höppner --- zipl/include/zipl.h | 1 - zipl/src/job.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zipl/include/zipl.h b/zipl/include/zipl.h index 8ed839ec..8a088810 100644 --- a/zipl/include/zipl.h +++ b/zipl/include/zipl.h @@ -21,7 +21,6 @@ #define DISK_LAYOUT_ID 0x00000001 #define ADDRESS_LIMIT 0x80000000UL -#define ADDRESS_LIMIT_KDUMP 0x2000000UL /* HSA size: 32 MiB */ #define UNSPECIFIED_ADDRESS -1UL #define MAXIMUM_PARMLINE_SIZE 0x380UL #define MAXIMUM_PHYSICAL_BLOCKSIZE 0x1000UL diff --git a/zipl/src/job.c b/zipl/src/job.c index c3d30a08..93ccd49c 100644 --- a/zipl/src/job.c +++ b/zipl/src/job.c @@ -19,6 +19,8 @@ #include #include +#include "lib/util_arch.h" + #include "error.h" #include "job.h" #include "misc.h" @@ -758,7 +760,8 @@ finalize_ipl_address_data(struct job_ipl_data* ipl, char *name) int num; int rc; - address_limit = ipl->is_kdump ? ADDRESS_LIMIT_KDUMP : ADDRESS_LIMIT; + address_limit = ipl->is_kdump ? + MIN(util_arch_hsa_maxsize(), ADDRESS_LIMIT) : ADDRESS_LIMIT; rc = get_ipl_components(ipl, &cl, &num); if (rc) return rc;