Fixing infinite loop on SCLP READ SCP INFO error
v2 cover Fixing infinite loop on SCLP READ SCP INFO error
Aborting on SCLP READ SCP INFO error leads to a deadloop.
The loop is:abort() -> exit() -> smp_teardown() -> smp_query_num_cpus() -> sclp_get_cpu_num() -> assert() -> abort()
Since smp_setup() is done after sclp_read_info() inside setup() this loop only happens when only the start processor is running. Let sclp_get_cpu_num() return 1 in this case.
Pierre Morel (1):
s390x: sclp: consider monoprocessor on read_info error
lib/s390x/sclp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
PATCH v2 1/1 s390x: sclp: consider monoprocessor on read_info error
A test would hang if an abort happens before SCLP Read SCP Information has completed.
--- lib/s390x/sclp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
lib/s390x/sclp.c +3 -2
@@ -119,8 +119,9 @@ void sclp_read_info(void)int sclp_get_cpu_num (void ) { -assert (read_info); -return read_info->entries_cpu; +if (read_info) +return read_info->entries_cpu; +return 1 ; }CPUEntry *sclp_get_cpu_entries (void )
Signature · 1 line
2.31.1
Re: [kvm-unit-tests PATCH v2 1/1] s390x: sclp: consider monoprocessor on read_info error
Quoting Pierre Morel (2023-04-27 09:54:50)
[...]
lib/s390x/sclp.c void sclp_read_info(void) · line 124
Quoted 13 lines
lib/s390x/sclp.c +3
-2@@ -119,8 +119,9 @@ void sclp_read_info(void)int sclp_get_cpu_num (void ) { -assert (read_info); -return read_info->entries_cpu; +if (read_info) +return read_info->entries_cpu; +return 1 ;
tab/spaces are mixed up here, please fix that.
Re: [kvm-unit-tests PATCH v2 1/1] s390x: sclp: consider monoprocessor on read_info error
Quoted 8 lines · Nico Boehr
Quoting Pierre Morel (2023-04-27 09:54:50)
[...]Quoted 6 lines
lib/s390x/sclp.c +0
-0@@ -119,8 +119,9 @@ void sclp_read_info(void)
Quoted 8 lines
lib/s390x/sclp.c void sclp_read_info(void) · line 124
Quoted 7 lines
lib/s390x/sclp.c +3
-2int sclp_get_cpu_num (void ) { -assert (read_info); -return read_info->entries_cpu; +if (read_info) +return read_info->entries_cpu; +return 1 ;tab/spaces are mixed up here, please fix that.
/o\ yes