mbox series

[kvm-unit-tests,v3,0/2] Fixing infinite loop on SCLP READ SCP INFO error

Message ID 20230530124056.18332-1-pmorel@linux.ibm.com (mailing list archive)
Headers show
Series Fixing infinite loop on SCLP READ SCP INFO error | expand

Message

Pierre Morel May 30, 2023, 12:40 p.m. UTC
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.

Also implement the SCLP_RC_INSUFFICIENT_SCCB_LENGTH handling and
repeat the sclp command.

Pierre Morel (2):
  s390x: sclp: consider monoprocessor on read_info error
  s390x: sclp: Implement SCLP_RC_INSUFFICIENT_SCCB_LENGTH

 lib/s390x/sclp.c | 64 ++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 56 insertions(+), 8 deletions(-)