On Mon, Oct 14, 2024 at 04:46:16PM +0200, David Hildenbrand wrote: Hi David! > @@ -157,7 +189,9 @@ unsigned long detect_max_physmem_end(void) > { > unsigned long max_physmem_end = 0; > > - if (!sclp_early_get_memsize(&max_physmem_end)) { > + if (!diag500_storage_limit(&max_physmem_end)) { > + physmem_info.info_source = MEM_DETECT_DIAG500_STOR_LIMIT; > + } else if (!sclp_early_get_memsize(&max_physmem_end)) { > physmem_info.info_source = MEM_DETECT_SCLP_READ_INFO; > } else { > max_physmem_end = search_mem_end(); > @@ -170,11 +204,17 @@ void detect_physmem_online_ranges(unsigned long max_physmem_end) > { > if (!sclp_early_read_storage_info()) { > physmem_info.info_source = MEM_DETECT_SCLP_STOR_INFO; > + return; > } else if (!diag260()) { > physmem_info.info_source = MEM_DETECT_DIAG260; > - } else if (max_physmem_end) { > - add_physmem_online_range(0, max_physmem_end); > + return; > + } else if (physmem_info.info_source == MEM_DETECT_DIAG500_STOR_LIMIT) { > + max_physmem_end = 0; > + if (!sclp_early_get_memsize(&max_physmem_end)) > + physmem_info.info_source = MEM_DETECT_SCLP_READ_INFO; Why search_mem_end() is not tried in case sclp_early_get_memsize() failed? > } > + if (max_physmem_end) > + add_physmem_online_range(0, max_physmem_end); > } > > void physmem_set_usable_limit(unsigned long limit) > diff --git a/arch/s390/include/asm/physmem_info.h b/arch/s390/include/asm/physmem_info.h > index f45cfc8bc233..51b68a43e195 100644 > --- a/arch/s390/include/asm/physmem_info.h > +++ b/arch/s390/include/asm/physmem_info.h > @@ -9,6 +9,7 @@ enum physmem_info_source { > MEM_DETECT_NONE = 0, > MEM_DETECT_SCLP_STOR_INFO, > MEM_DETECT_DIAG260, > + MEM_DETECT_DIAG500_STOR_LIMIT, > MEM_DETECT_SCLP_READ_INFO, > MEM_DETECT_BIN_SEARCH > }; > @@ -107,6 +108,8 @@ static inline const char *get_physmem_info_source(void) > return "sclp storage info"; > case MEM_DETECT_DIAG260: > return "diag260"; > + case MEM_DETECT_DIAG500_STOR_LIMIT: > + return "diag500 storage limit"; AFAIU you want to always override MEM_DETECT_DIAG500_STOR_LIMIT method with an online memory detection method. In that case this code is dead. > case MEM_DETECT_SCLP_READ_INFO: > return "sclp read info"; > case MEM_DETECT_BIN_SEARCH: Thanks!