From: Janosch Frank <frankja@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
thuth@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com
Subject: [kvm-unit-tests PATCH v4 4/8] s390x: uv-host: Add cpu number check to test_init
Date: Thu, 22 Jun 2023 07:50:50 +0000 [thread overview]
Message-ID: <20230622075054.3190-5-frankja@linux.ibm.com> (raw)
In-Reply-To: <20230622075054.3190-1-frankja@linux.ibm.com>
We should only run a test that needs more than one cpu if a sufficient
number of cpus are available.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
---
s390x/uv-host.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/s390x/uv-host.c b/s390x/uv-host.c
index 08ef266a..c04cdd73 100644
--- a/s390x/uv-host.c
+++ b/s390x/uv-host.c
@@ -550,11 +550,15 @@ static void test_init(void)
"storage below 2GB");
uvcb_init.stor_origin = tmp;
- smp_cpu_setup(1, PSW_WITH_CUR_MASK(cpu_loop));
- rc = uv_call(0, (uint64_t)&uvcb_init);
- report(rc == 1 && uvcb_init.header.rc == 0x102,
- "too many running cpus");
- smp_cpu_stop(1);
+ if (smp_query_num_cpus() > 1) {
+ smp_cpu_setup(1, PSW_WITH_CUR_MASK(cpu_loop));
+ rc = uv_call(0, (uint64_t)&uvcb_init);
+ report(rc == 1 && uvcb_init.header.rc == 0x102,
+ "too many running cpus");
+ smp_cpu_stop(1);
+ } else {
+ report_skip("Not enough cpus for 0x102 test");
+ }
rc = uv_call(0, (uint64_t)&uvcb_init);
report(rc == 0 && uvcb_init.header.rc == UVC_RC_EXECUTED, "successful");
--
2.34.1
next prev parent reply other threads:[~2023-06-22 7:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 7:50 [kvm-unit-tests PATCH v4 0/8] s390x: uv-host: Fixups and extensions part 1 Janosch Frank
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 1/8] s390x: uv-host: Fix UV init test memory allocation Janosch Frank
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 2/8] s390x: uv-host: Check for sufficient amount of memory Janosch Frank
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 3/8] s390x: uv-host: Beautify code Janosch Frank
2023-06-22 7:50 ` Janosch Frank [this message]
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 5/8] s390x: uv-host: Remove create guest variable storage prefix check Janosch Frank
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 6/8] s390x: uv-host: Properly handle config creation errors Janosch Frank
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 7/8] s390x: uv-host: Fence access checks when UV debug is enabled Janosch Frank
2023-06-22 7:50 ` [kvm-unit-tests PATCH v4 8/8] s390x: uv-host: Add the test to unittests.conf Janosch Frank
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=20230622075054.3190-5-frankja@linux.ibm.com \
--to=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