diff mbox series

[kvm-unit-tests,v5,3/7] s390x: Stop the cpu that is executing exit()

Message ID 20200201152851.82867-4-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: smp: Improve smp code and reset checks | expand

Commit Message

Janosch Frank Feb. 1, 2020, 3:28 p.m. UTC
CPU 0 is not necessarily the CPU which does the exit if we ran into a
test abort situation. So, let's ask stap() which cpu does the exit and
stop it on exit.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 lib/s390x/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth Feb. 1, 2020, 6:55 p.m. UTC | #1
On 01/02/2020 16.28, Janosch Frank wrote:
> CPU 0 is not necessarily the CPU which does the exit if we ran into a
> test abort situation. So, let's ask stap() which cpu does the exit and
> stop it on exit.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/io.c b/lib/s390x/io.c
> index 32f09b5..e091c37 100644
> --- a/lib/s390x/io.c
> +++ b/lib/s390x/io.c
> @@ -46,6 +46,6 @@ void exit(int code)
>  	smp_teardown();
>  	printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
>  	while (1) {
> -		sigp(0, SIGP_STOP, 0, NULL);
> +		sigp(stap(), SIGP_STOP, 0, NULL);
>  	}
>  }

Right, smp_teardown stops already all CPUs except for the current one,
so this is the last one running here.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Cornelia Huck Feb. 3, 2020, 11:19 a.m. UTC | #2
On Sat,  1 Feb 2020 10:28:47 -0500
Janosch Frank <frankja@linux.ibm.com> wrote:

> CPU 0 is not necessarily the CPU which does the exit if we ran into a
> test abort situation. So, let's ask stap() which cpu does the exit and
> stop it on exit.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
diff mbox series

Patch

diff --git a/lib/s390x/io.c b/lib/s390x/io.c
index 32f09b5..e091c37 100644
--- a/lib/s390x/io.c
+++ b/lib/s390x/io.c
@@ -46,6 +46,6 @@  void exit(int code)
 	smp_teardown();
 	printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
 	while (1) {
-		sigp(0, SIGP_STOP, 0, NULL);
+		sigp(stap(), SIGP_STOP, 0, NULL);
 	}
 }