public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: linux-s390@vger.kernel.org
Cc: frankja@linux.ibm.com, thuth@redhat.com, kvm@vger.kernel.org,
	imbrenda@linux.ibm.com, david@redhat.com, nrb@linux.ibm.com,
	nsg@linux.ibm.com, cohuck@redhat.com
Subject: [kvm-unit-tests PATCH v5 0/2] Fixing infinite loop on SCLP READ SCP INFO error
Date: Thu,  1 Jun 2023 18:45:35 +0200	[thread overview]
Message-ID: <20230601164537.31769-1-pmorel@linux.ibm.com> (raw)

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(-)

-- 
2.31.1

since v4:

- changed comments
  (Nico)

- use a big buffer from the start if possible
  (Claudio)

since v3:

- added initial patch and merge with comments
  Sorry for the noise.

since v2:

- use tabs in first patch
  (Nico)

- Added comments

- Added SCLP_RC_INSUFFICIENT_SCCB_LENGTH handling

             reply	other threads:[~2023-06-01 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 16:45 Pierre Morel [this message]
2023-06-01 16:45 ` [kvm-unit-tests PATCH v5 1/2] s390x: sclp: treat system as single processor when read_info is NULL Pierre Morel
2023-06-01 16:45 ` [kvm-unit-tests PATCH v5 2/2] s390x: sclp: Implement extended-length-SCCB facility Pierre Morel
2023-06-01 16:58   ` Pierre Morel
2023-06-02  8:24 ` [kvm-unit-tests PATCH v5 0/2] Fixing infinite loop on SCLP READ SCP INFO error Nico Boehr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230601164537.31769-1-pmorel@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=nsg@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox