public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Eric Farman <farman@linux.ibm.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
Subject: Re: [PATCH kvm-unit-tests v2 2/6] s390x: smp: Test SIGP RESTART against stopped CPU
Date: Thu, 24 Mar 2022 09:15:06 +0100	[thread overview]
Message-ID: <4cd394c9-e43a-4831-d39e-66dcb3d95074@redhat.com> (raw)
In-Reply-To: <20220311173822.1234617-3-farman@linux.ibm.com>

On 11/03/2022 18.38, Eric Farman wrote:
> test_restart() makes two smp_cpu_restart() calls against CPU 1.
> It claims to perform both of them against running (operating) CPUs,
> but the first invocation tries to achieve this by calling
> smp_cpu_stop() to CPU 0. This will be rejected by the library.
> 
> Let's fix this by making the first restart operate on a stopped CPU,
> to ensure it gets test coverage instead of relying on other callers.
> 
> Fixes: 166da884d ("s390x: smp: Add restart when running test")
> 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>
> ---
>   s390x/smp.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/s390x/smp.c b/s390x/smp.c
> index 068ac74d..2f4af820 100644
> --- a/s390x/smp.c
> +++ b/s390x/smp.c
> @@ -50,10 +50,6 @@ static void test_start(void)
>   	report_pass("start");
>   }
>   
> -/*
> - * Does only test restart when the target is running.
> - * The other tests do restarts when stopped multiple times already.
> - */
>   static void test_restart(void)
>   {
>   	struct cpu *cpu = smp_cpu_from_idx(1);
> @@ -62,8 +58,8 @@ static void test_restart(void)
>   	lc->restart_new_psw.mask = extract_psw_mask();
>   	lc->restart_new_psw.addr = (unsigned long)test_func;
>   
> -	/* Make sure cpu is running */
> -	smp_cpu_stop(0);
> +	/* Make sure cpu is stopped */
> +	smp_cpu_stop(1);

It might be a good idea to check the return code of smp_cpu_stop() for 
success ... but that can also be done in a later patch, so for this one:

Reviewed-by: Thomas Huth <thuth@redhat.com>


>   	set_flag(0);
>   	smp_cpu_restart(1);
>   	wait_for_flag();


  reply	other threads:[~2022-03-24  8:15 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 ` [PATCH kvm-unit-tests v2 1/6] lib: s390x: smp: Retry SIGP SENSE on CC2 Eric Farman
2022-03-24  8:08   ` 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 [this message]
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=4cd394c9-e43a-4831-d39e-66dcb3d95074@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.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 \
    /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