From: Eric Farman <farman@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Nico Boehr <nrb@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org,
Eric Farman <farman@linux.ibm.com>
Subject: [PATCH kvm-unit-tests v2 1/6] lib: s390x: smp: Retry SIGP SENSE on CC2
Date: Fri, 11 Mar 2022 18:38:17 +0100 [thread overview]
Message-ID: <20220311173822.1234617-2-farman@linux.ibm.com> (raw)
In-Reply-To: <20220311173822.1234617-1-farman@linux.ibm.com>
The routine smp_cpu_stopped() issues a SIGP SENSE, and returns true
if it received a CC1 (STATUS STORED) with the STOPPED or CHECK STOP
bits enabled. Otherwise, it returns false.
This is misleading, because a CC2 (BUSY) merely indicates that the
order code could not be processed, not that the CPU is operating.
It could be operating but in the process of being stopped.
Convert the invocation of the SIGP SENSE to retry when a CC2 is
received, so we get a more definitive answer.
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
lib/s390x/smp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/s390x/smp.c b/lib/s390x/smp.c
index 46e1b022..368d6add 100644
--- a/lib/s390x/smp.c
+++ b/lib/s390x/smp.c
@@ -78,7 +78,7 @@ bool smp_cpu_stopped(uint16_t idx)
{
uint32_t status;
- if (smp_sigp(idx, SIGP_SENSE, 0, &status) != SIGP_CC_STATUS_STORED)
+ if (smp_sigp_retry(idx, SIGP_SENSE, 0, &status) != SIGP_CC_STATUS_STORED)
return false;
return !!(status & (SIGP_STATUS_CHECK_STOP|SIGP_STATUS_STOPPED));
}
--
2.32.0
next prev parent reply other threads:[~2022-03-11 17:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 17:38 [PATCH kvm-unit-tests v2 0/6] s390x SIGP fixes Eric Farman
2022-03-11 17:38 ` Eric Farman [this message]
2022-03-24 8:08 ` [PATCH kvm-unit-tests v2 1/6] lib: s390x: smp: Retry SIGP SENSE on CC2 Thomas Huth
2022-03-11 17:38 ` [PATCH kvm-unit-tests v2 2/6] s390x: smp: Test SIGP RESTART against stopped CPU Eric Farman
2022-03-24 8:15 ` Thomas Huth
2022-03-11 17:38 ` [PATCH kvm-unit-tests v2 3/6] s390x: smp: Fix checks for SIGP STOP STORE STATUS Eric Farman
2022-03-15 6:39 ` Nico Boehr
2022-03-15 17:39 ` Claudio Imbrenda
2022-03-11 17:38 ` [PATCH kvm-unit-tests v2 4/6] s390x: smp: Create and use a non-waiting CPU stop Eric Farman
2022-03-15 6:45 ` Nico Boehr
2022-03-11 17:38 ` [PATCH kvm-unit-tests v2 5/6] s390x: smp: Create and use a non-waiting CPU restart Eric Farman
2022-03-15 6:51 ` Nico Boehr
2022-03-21 7:43 ` Janosch Frank
2022-03-11 17:38 ` [PATCH kvm-unit-tests v2 6/6] lib: s390x: smp: Remove smp_sigp_retry Eric Farman
2022-03-15 7:20 ` 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=20220311173822.1234617-2-farman@linux.ibm.com \
--to=farman@linux.ibm.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=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