mbox series

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

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

Message

Pierre Morel June 1, 2023, 4:45 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 provide a bigger buffer for SCLP READ INFO when we have the
extended-length-SCCB facility.

Pierre

Pierre Morel (2):
  s390x: sclp: treat system as single processor when read_info is NULL
  s390x: sclp: Implement extended-length-SCCB facility

 lib/s390x/sclp.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Comments

Nico Boehr June 2, 2023, 8:24 a.m. UTC | #1
Quoting Pierre Morel (2023-06-01 18:45:35)
> 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 provide a bigger buffer for SCLP READ INFO when we have the
> extended-length-SCCB facility.
> 
> Pierre

Thanks for your patience Pierre.

Pushed to devel with the fixup to patch 2.