From patchwork Tue Feb 4 07:13:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364117 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CA2013A4 for ; Tue, 4 Feb 2020 07:13:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50A2F21775 for ; Tue, 4 Feb 2020 07:13:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="W+JnyaHi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbgBDHNs (ORCPT ); Tue, 4 Feb 2020 02:13:48 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20592 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726053AbgBDHNs (ORCPT ); Tue, 4 Feb 2020 02:13:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=uYQgQSLkVmftwYeud7Lp3Fio62OSlQzGpPE26l50Te0=; b=W+JnyaHi5c3tsZMUhBOXs3gtqWOVEW/0lF2ixORJEQp2D/EMkiRWM8MI0pvEeOh+q0cSUl 1+wsQ28Je7wj2pCQuTwJ65ooJnHrYB5q9A+uxx2RsbAAYguTuaGmB7QdcqznmOQ24Ysqhs mBE/AfqLhuJcIyXMFyUOsx1RrSFELPo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-F9MBVDcYO0OIxrbFqOzQJA-1; Tue, 04 Feb 2020 02:13:45 -0500 X-MC-Unique: F9MBVDcYO0OIxrbFqOzQJA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 366F01090785; Tue, 4 Feb 2020 07:13:44 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D33E45C1D8; Tue, 4 Feb 2020 07:13:42 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 1/9] s390x: smp: Cleanup smp.c Date: Tue, 4 Feb 2020 08:13:27 +0100 Message-Id: <20200204071335.18180-2-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank Let's remove a lot of badly formatted code by introducing the wait_for_flag() and set_flag functions. Also let's remove some stray spaces and always set the testflag before using it. Signed-off-by: Janosch Frank Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Message-Id: <20200201152851.82867-2-frankja@linux.ibm.com> Signed-off-by: Thomas Huth --- s390x/smp.c | 55 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/s390x/smp.c b/s390x/smp.c index ab7e46c..e37eb56 100644 --- a/s390x/smp.c +++ b/s390x/smp.c @@ -22,6 +22,19 @@ static int testflag = 0; +static void wait_for_flag(void) +{ + while (!testflag) + mb(); +} + +static void set_flag(int val) +{ + mb(); + testflag = val; + mb(); +} + static void cpu_loop(void) { for (;;) {} @@ -29,21 +42,19 @@ static void cpu_loop(void) static void test_func(void) { - testflag = 1; - mb(); + set_flag(1); cpu_loop(); } static void test_start(void) { struct psw psw; - psw.mask = extract_psw_mask(); + psw.mask = extract_psw_mask(); psw.addr = (unsigned long)test_func; + set_flag(0); smp_cpu_setup(1, psw); - while (!testflag) { - mb(); - } + wait_for_flag(); report(1, "start"); } @@ -112,27 +123,27 @@ static void ecall(void) mask = extract_psw_mask(); mask |= PSW_MASK_EXT; load_psw_mask(mask); - testflag = 1; + set_flag(1); while (lc->ext_int_code != 0x1202) { mb(); } report(1, "ecall"); - testflag= 1; + set_flag(1); } static void test_ecall(void) { struct psw psw; - psw.mask = extract_psw_mask(); + psw.mask = extract_psw_mask(); psw.addr = (unsigned long)ecall; report_prefix_push("ecall"); - testflag= 0; + set_flag(0); smp_cpu_destroy(1); smp_cpu_setup(1, psw); - while (!testflag) { mb(); } - testflag= 0; + wait_for_flag(); + set_flag(0); sigp(1, SIGP_EXTERNAL_CALL, 0, NULL); - while(!testflag) {mb();} + wait_for_flag(); smp_cpu_stop(1); report_prefix_pop(); } @@ -147,27 +158,27 @@ static void emcall(void) mask = extract_psw_mask(); mask |= PSW_MASK_EXT; load_psw_mask(mask); - testflag= 1; + set_flag(1); while (lc->ext_int_code != 0x1201) { mb(); } report(1, "ecall"); - testflag = 1; + set_flag(1); } static void test_emcall(void) { struct psw psw; - psw.mask = extract_psw_mask(); + psw.mask = extract_psw_mask(); psw.addr = (unsigned long)emcall; report_prefix_push("emcall"); - testflag= 0; + set_flag(0); smp_cpu_destroy(1); smp_cpu_setup(1, psw); - while (!testflag) { mb(); } - testflag= 0; + wait_for_flag(); + set_flag(0); sigp(1, SIGP_EMERGENCY_SIGNAL, 0, NULL); - while(!testflag) { mb(); } + wait_for_flag(); smp_cpu_stop(1); report_prefix_pop(); } @@ -177,7 +188,7 @@ static void test_reset_initial(void) struct cpu_status *status = alloc_pages(0); struct psw psw; - psw.mask = extract_psw_mask(); + psw.mask = extract_psw_mask(); psw.addr = (unsigned long)test_func; report_prefix_push("reset initial"); @@ -208,7 +219,7 @@ static void test_reset(void) { struct psw psw; - psw.mask = extract_psw_mask(); + psw.mask = extract_psw_mask(); psw.addr = (unsigned long)test_func; report_prefix_push("cpu reset"); From patchwork Tue Feb 4 07:13:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364129 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9490213A4 for ; Tue, 4 Feb 2020 07:13:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73DD52192A for ; Tue, 4 Feb 2020 07:13:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XOiEoron" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbgBDHNt (ORCPT ); Tue, 4 Feb 2020 02:13:49 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:60072 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726479AbgBDHNt (ORCPT ); Tue, 4 Feb 2020 02:13:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=6pE1yV5HBsGmICoUbkwNIntIfVP3d3daOMPPmOVPbEY=; b=XOiEoronLf0bK+zkE89PwmXZ9Pv03xsp0TS/wF0OKhlP87VyUlarhMGqzISmpUTGf0twAB 1g5BODYTE9VNTiijZjoqhDJ+d48NtdHBkzDQJ7iB+aUTtIvCRpK3pghgkFeyfb6hjt+J1q Rs77F0JHy97UYSBXnOo0FYCHZwKuRKU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-rKXpjoJOMK6yxPGTtKieWg-1; Tue, 04 Feb 2020 02:13:46 -0500 X-MC-Unique: rKXpjoJOMK6yxPGTtKieWg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B40DDA0CBF; Tue, 4 Feb 2020 07:13:45 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9354C5C1D4; Tue, 4 Feb 2020 07:13:44 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 2/9] s390x: smp: Fix ecall and emcall report strings Date: Tue, 4 Feb 2020 08:13:28 +0100 Message-Id: <20200204071335.18180-3-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank Instead of "smp: ecall: ecall" we now get "smp: ecall: received". Signed-off-by: Janosch Frank Message-Id: <20200201152851.82867-3-frankja@linux.ibm.com> Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- s390x/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s390x/smp.c b/s390x/smp.c index e37eb56..93a9594 100644 --- a/s390x/smp.c +++ b/s390x/smp.c @@ -125,7 +125,7 @@ static void ecall(void) load_psw_mask(mask); set_flag(1); while (lc->ext_int_code != 0x1202) { mb(); } - report(1, "ecall"); + report(1, "received"); set_flag(1); } @@ -160,7 +160,7 @@ static void emcall(void) load_psw_mask(mask); set_flag(1); while (lc->ext_int_code != 0x1201) { mb(); } - report(1, "ecall"); + report(1, "received"); set_flag(1); } From patchwork Tue Feb 4 07:13:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52B1814E3 for ; Tue, 4 Feb 2020 07:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32C3C2166E for ; Tue, 4 Feb 2020 07:13:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J1mlALhe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbgBDHNv (ORCPT ); Tue, 4 Feb 2020 02:13:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:49000 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726406AbgBDHNu (ORCPT ); Tue, 4 Feb 2020 02:13:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=FJSLRqnUOmBGqCSh0mxQAQkRf4rFOdRIZLA+FkEnWYk=; b=J1mlALhePh6lD7HpqWh40tBzWA1DpLc4IHi0l59zoQxauxCRW6KmtgaS3V4Zbi7VBg5zCc FVGmeCxJmgWwOavrePgEv/lRIofehV+KOr7mlzVkyL7CpMSYbM22ohZTQPUf7YfHXYLREx V6/iitTvrQAp8N1DJLPKUX/r9j2Mv1U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-32-xQxhe7tjMBWVqGdbOVRzGA-1; Tue, 04 Feb 2020 02:13:48 -0500 X-MC-Unique: xQxhe7tjMBWVqGdbOVRzGA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45A498010CB; Tue, 4 Feb 2020 07:13:47 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0ACEE5C1D4; Tue, 4 Feb 2020 07:13:45 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 3/9] s390x: Stop the cpu that is executing exit() Date: Tue, 4 Feb 2020 08:13:29 +0100 Message-Id: <20200204071335.18180-4-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank 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 Message-Id: <20200201152851.82867-4-frankja@linux.ibm.com> Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- 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); } } From patchwork Tue Feb 4 07:13:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364123 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49EC913A4 for ; Tue, 4 Feb 2020 07:13:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2863A21744 for ; Tue, 4 Feb 2020 07:13:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CDTpV5gX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbgBDHNy (ORCPT ); Tue, 4 Feb 2020 02:13:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:41028 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727192AbgBDHNx (ORCPT ); Tue, 4 Feb 2020 02:13:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=OAV4F2+o9s/Gjq4pV+na9/3hpXSOMYF+C/ORbZgIhNA=; b=CDTpV5gXsgVr+r5imdyHM9F4YoHurLixnNqXjBqjP1gcCRlkRPuTSNO9eon7jb3uZLwyes GoPDlkNnozhYKDjIXTxAoL81irANYr8MbkJsJoXAIBwhfkCP5lCi6xgQejZJU9ZI/mtZ2D gcAnGDUCbghK/1DGK3qyJBaMognmi5o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-116-_iqiQbe_MBSS9JA3O5FBtA-1; Tue, 04 Feb 2020 02:13:49 -0500 X-MC-Unique: _iqiQbe_MBSS9JA3O5FBtA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1FA985EE6A; Tue, 4 Feb 2020 07:13:48 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4E6C5C1D4; Tue, 4 Feb 2020 07:13:47 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 4/9] s390x: Add cpu id to interrupt error prints Date: Tue, 4 Feb 2020 08:13:30 +0100 Message-Id: <20200204071335.18180-5-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank It's good to know which cpu broke the test. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck Message-Id: <20200201152851.82867-5-frankja@linux.ibm.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- lib/s390x/interrupt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c index ccb376a..3a40cac 100644 --- a/lib/s390x/interrupt.c +++ b/lib/s390x/interrupt.c @@ -109,8 +109,8 @@ void handle_pgm_int(void) if (!pgm_int_expected) { /* Force sclp_busy to false, otherwise we will loop forever */ sclp_handle_ext(); - report_abort("Unexpected program interrupt: %d at %#lx, ilen %d\n", - lc->pgm_int_code, lc->pgm_old_psw.addr, + report_abort("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n", + lc->pgm_int_code, stap(), lc->pgm_old_psw.addr, lc->pgm_int_id); } @@ -122,8 +122,8 @@ void handle_ext_int(void) { if (!ext_int_expected && lc->ext_int_code != EXT_IRQ_SERVICE_SIG) { - report_abort("Unexpected external call interrupt (code %#x): at %#lx", - lc->ext_int_code, lc->ext_old_psw.addr); + report_abort("Unexpected external call interrupt (code %#x): on cpu %d at %#lx", + lc->ext_int_code, stap(), lc->ext_old_psw.addr); return; } @@ -140,18 +140,18 @@ void handle_ext_int(void) void handle_mcck_int(void) { - report_abort("Unexpected machine check interrupt: at %#lx", - lc->mcck_old_psw.addr); + report_abort("Unexpected machine check interrupt: on cpu %d at %#lx", + stap(), lc->mcck_old_psw.addr); } void handle_io_int(void) { - report_abort("Unexpected io interrupt: at %#lx", - lc->io_old_psw.addr); + report_abort("Unexpected io interrupt: on cpu %d at %#lx", + stap(), lc->io_old_psw.addr); } void handle_svc_int(void) { - report_abort("Unexpected supervisor call interrupt: at %#lx", - lc->svc_old_psw.addr); + report_abort("Unexpected supervisor call interrupt: on cpu %d at %#lx", + stap(), lc->svc_old_psw.addr); } From patchwork Tue Feb 4 07:13:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364125 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A466A13A4 for ; Tue, 4 Feb 2020 07:13:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 815F821744 for ; Tue, 4 Feb 2020 07:13:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NGVC/xd5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727236AbgBDHNz (ORCPT ); Tue, 4 Feb 2020 02:13:55 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21696 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727199AbgBDHNy (ORCPT ); Tue, 4 Feb 2020 02:13:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=ZzDxOK+pIqxVlN9Uam+pyOBD/aAlOx/kYWT71p0Utnc=; b=NGVC/xd5QlSPrH5Azl1MybkoXj70eqOCm5lyafYWiwqmMGBKQ1xBwF2o8ASMWlZFJsq3Rw ZXauIg2JrjdzZJgR7p1m1bJBFCk5lmDwjEnJUkZ+058pt5D7hTSqkGIE/eP4Bng40fKP1C h6NcRUCzvYIG/GNAXYtPna8rlTJJRQ8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-436-38zMEIR7Om6Dtj8OgCEj7w-1; Tue, 04 Feb 2020 02:13:51 -0500 X-MC-Unique: 38zMEIR7Om6Dtj8OgCEj7w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 71AEAA0CC1; Tue, 4 Feb 2020 07:13:50 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 434525C1D4; Tue, 4 Feb 2020 07:13:49 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 5/9] s390x: smp: Only use smp_cpu_setup once Date: Tue, 4 Feb 2020 08:13:31 +0100 Message-Id: <20200204071335.18180-6-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank Let's stop and start instead of using setup to run a function on a cpu. Signed-off-by: Janosch Frank Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Acked-by: David Hildenbrand Message-Id: <20200201152851.82867-6-frankja@linux.ibm.com> Signed-off-by: Thomas Huth --- s390x/smp.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/s390x/smp.c b/s390x/smp.c index 93a9594..fa40753 100644 --- a/s390x/smp.c +++ b/s390x/smp.c @@ -53,7 +53,7 @@ static void test_start(void) psw.addr = (unsigned long)test_func; set_flag(0); - smp_cpu_setup(1, psw); + smp_cpu_start(1, psw); wait_for_flag(); report(1, "start"); } @@ -109,6 +109,7 @@ static void test_store_status(void) report(1, "status written"); free_pages(status, PAGE_SIZE * 2); report_prefix_pop(); + smp_cpu_stop(1); report_prefix_pop(); } @@ -137,9 +138,8 @@ static void test_ecall(void) report_prefix_push("ecall"); set_flag(0); - smp_cpu_destroy(1); - smp_cpu_setup(1, psw); + smp_cpu_start(1, psw); wait_for_flag(); set_flag(0); sigp(1, SIGP_EXTERNAL_CALL, 0, NULL); @@ -172,9 +172,8 @@ static void test_emcall(void) report_prefix_push("emcall"); set_flag(0); - smp_cpu_destroy(1); - smp_cpu_setup(1, psw); + smp_cpu_start(1, psw); wait_for_flag(); set_flag(0); sigp(1, SIGP_EMERGENCY_SIGNAL, 0, NULL); @@ -192,7 +191,7 @@ static void test_reset_initial(void) psw.addr = (unsigned long)test_func; report_prefix_push("reset initial"); - smp_cpu_setup(1, psw); + smp_cpu_start(1, psw); sigp_retry(1, SIGP_INITIAL_CPU_RESET, 0, NULL); sigp(1, SIGP_STORE_STATUS_AT_ADDRESS, (uintptr_t)status, NULL); @@ -223,7 +222,7 @@ static void test_reset(void) psw.addr = (unsigned long)test_func; report_prefix_push("cpu reset"); - smp_cpu_setup(1, psw); + smp_cpu_start(1, psw); sigp_retry(1, SIGP_CPU_RESET, 0, NULL); report(smp_cpu_stopped(1), "cpu stopped"); @@ -232,6 +231,7 @@ static void test_reset(void) int main(void) { + struct psw psw; report_prefix_push("smp"); if (smp_query_num_cpus() == 1) { @@ -239,6 +239,12 @@ int main(void) goto done; } + /* Setting up the cpu to give it a stack and lowcore */ + psw.mask = extract_psw_mask(); + psw.addr = (unsigned long)cpu_loop; + smp_cpu_setup(1, psw); + smp_cpu_stop(1); + test_start(); test_stop(); test_stop_store_status(); @@ -247,6 +253,7 @@ int main(void) test_emcall(); test_reset(); test_reset_initial(); + smp_cpu_destroy(1); done: report_prefix_pop(); From patchwork Tue Feb 4 07:13:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364127 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0FF814E3 for ; Tue, 4 Feb 2020 07:13:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F7C22166E for ; Tue, 4 Feb 2020 07:13:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jKxB42Nw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727242AbgBDHN4 (ORCPT ); Tue, 4 Feb 2020 02:13:56 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20937 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725834AbgBDHN4 (ORCPT ); Tue, 4 Feb 2020 02:13:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=/hdIUNxmNRqt4zaw3xAf/IgcFBF5K2rkiMWYAX1h6Ek=; b=jKxB42Nwltds5SsVhraU2CF4Qj6hLgZUUwZZUltwMpH/58pAtgyXPvR8iSe8RFMwvE3VuU A6DMy/WFV2p4kUYt441Fs6BZjm9Zorndcg9SQJcvlM2uV1c1nTA4gS74jUv15038y32TT4 Q8ihP1rimp+F+5p4l/Mv9fy/LNGFBJg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-57DPMwZgNa61ONB3uAnfdg-1; Tue, 04 Feb 2020 02:13:53 -0500 X-MC-Unique: 57DPMwZgNa61ONB3uAnfdg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18D1718B644C; Tue, 4 Feb 2020 07:13:52 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF9D85C1D4; Tue, 4 Feb 2020 07:13:50 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 6/9] s390x: smp: Rework cpu start and active tracking Date: Tue, 4 Feb 2020 08:13:32 +0100 Message-Id: <20200204071335.18180-7-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank The architecture specifies that processing sigp orders may be asynchronous, and this is indeed the case on some hypervisors, so we need to wait until the cpu runs before we return from the setup/start function. As there was a lot of duplicate code, a common function for cpu restarts has been introduced. Signed-off-by: Janosch Frank Reviewed-by: Cornelia Huck Message-Id: <20200201152851.82867-7-frankja@linux.ibm.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- lib/s390x/smp.c | 56 ++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/lib/s390x/smp.c b/lib/s390x/smp.c index f57f420..4578003 100644 --- a/lib/s390x/smp.c +++ b/lib/s390x/smp.c @@ -104,35 +104,52 @@ int smp_cpu_stop_store_status(uint16_t addr) return rc; } +static int smp_cpu_restart_nolock(uint16_t addr, struct psw *psw) +{ + int rc; + struct cpu *cpu = smp_cpu_from_addr(addr); + + if (!cpu) + return -1; + if (psw) { + cpu->lowcore->restart_new_psw.mask = psw->mask; + cpu->lowcore->restart_new_psw.addr = psw->addr; + } + /* + * Stop the cpu, so we don't have a race between a running cpu + * and the restart in the test that checks if the cpu is + * running after the restart. + */ + smp_cpu_stop_nolock(addr, false); + rc = sigp(addr, SIGP_RESTART, 0, NULL); + if (rc) + return rc; + /* + * The order has been accepted, but the actual restart may not + * have been performed yet, so wait until the cpu is running. + */ + while (!smp_cpu_running(addr)) + mb(); + cpu->active = true; + return 0; +} + int smp_cpu_restart(uint16_t addr) { - int rc = -1; - struct cpu *cpu; + int rc; spin_lock(&lock); - cpu = smp_cpu_from_addr(addr); - if (cpu) { - rc = sigp(addr, SIGP_RESTART, 0, NULL); - cpu->active = true; - } + rc = smp_cpu_restart_nolock(addr, NULL); spin_unlock(&lock); return rc; } int smp_cpu_start(uint16_t addr, struct psw psw) { - int rc = -1; - struct cpu *cpu; - struct lowcore *lc; + int rc; spin_lock(&lock); - cpu = smp_cpu_from_addr(addr); - if (cpu) { - lc = cpu->lowcore; - lc->restart_new_psw.mask = psw.mask; - lc->restart_new_psw.addr = psw.addr; - rc = sigp(addr, SIGP_RESTART, 0, NULL); - } + rc = smp_cpu_restart_nolock(addr, &psw); spin_unlock(&lock); return rc; } @@ -192,10 +209,7 @@ int smp_cpu_setup(uint16_t addr, struct psw psw) lc->sw_int_crs[0] = 0x0000000000040000UL; /* Start processing */ - rc = sigp_retry(cpu->addr, SIGP_RESTART, 0, NULL); - if (!rc) - cpu->active = true; - + smp_cpu_restart_nolock(addr, NULL); out: spin_unlock(&lock); return rc; From patchwork Tue Feb 4 07:13:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364133 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D97917E0 for ; Tue, 4 Feb 2020 07:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43AF52166E for ; Tue, 4 Feb 2020 07:14:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QL5y3mAA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727269AbgBDHOA (ORCPT ); Tue, 4 Feb 2020 02:14:00 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41234 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725834AbgBDHN6 (ORCPT ); Tue, 4 Feb 2020 02:13:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=6hsLWcttreSGRgYk7YYpJiVWchjMZwHmFaSUuP438V8=; b=QL5y3mAACPpF6OZH9+ey8am/6XHPZxg+oxUsDTNo+ycgygB4V0Devlv+InQ3SrvLrNWYuz /q0gq26xzeIJW/jdoGHCItfom7sg8pW3jjemGIpENHrrFKtpaJxmGikL0sMR3w7gbRtB4D wcRoYDpDSZJ0rWBXw5shIHQ4bHffDGE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-123--bScj_qZOTWVHmHrkLXIAQ-1; Tue, 04 Feb 2020 02:13:54 -0500 X-MC-Unique: -bScj_qZOTWVHmHrkLXIAQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8CB91090780; Tue, 4 Feb 2020 07:13:53 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 773BA5C1D4; Tue, 4 Feb 2020 07:13:52 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Janosch Frank Subject: [kvm-unit-tests PULL 7/9] s390x: smp: Wait for cpu setup to finish Date: Tue, 4 Feb 2020 08:13:33 +0100 Message-Id: <20200204071335.18180-8-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank We store the user provided psw address into restart new, so a psw restart does not lead us through setup again. Also we wait on smp_cpu_setup() until the cpu has finished setup before returning. This is necessary for z/VM and LPAR where sigp is asynchronous. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck Message-Id: <20200201152851.82867-8-frankja@linux.ibm.com> Signed-off-by: Thomas Huth --- lib/s390x/smp.c | 3 +++ s390x/cstart64.S | 2 ++ 2 files changed, 5 insertions(+) diff --git a/lib/s390x/smp.c b/lib/s390x/smp.c index 4578003..3f86243 100644 --- a/lib/s390x/smp.c +++ b/lib/s390x/smp.c @@ -210,6 +210,9 @@ int smp_cpu_setup(uint16_t addr, struct psw psw) /* Start processing */ smp_cpu_restart_nolock(addr, NULL); + /* Wait until the cpu has finished setup and started the provided psw */ + while (lc->restart_new_psw.addr != psw.addr) + mb(); out: spin_unlock(&lock); return rc; diff --git a/s390x/cstart64.S b/s390x/cstart64.S index 86dd4c4..9af6bb3 100644 --- a/s390x/cstart64.S +++ b/s390x/cstart64.S @@ -159,6 +159,8 @@ smp_cpu_setup_state: xgr %r1, %r1 lmg %r0, %r15, GEN_LC_SW_INT_GRS lctlg %c0, %c0, GEN_LC_SW_INT_CRS + /* We should only go once through cpu setup and not for every restart */ + stg %r14, GEN_LC_RESTART_NEW_PSW + 8 br %r14 pgm_int: From patchwork Tue Feb 4 07:13:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364131 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C799C14E3 for ; Tue, 4 Feb 2020 07:14:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D9D121741 for ; Tue, 4 Feb 2020 07:14:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qo9asl2S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbgBDHN7 (ORCPT ); Tue, 4 Feb 2020 02:13:59 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30977 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727237AbgBDHN6 (ORCPT ); Tue, 4 Feb 2020 02:13:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=/66ISL3Mm1HtWe/pNh0zOYoz/9Pwhfw5Q6nsv8PoPy4=; b=Qo9asl2StJvCbrmL8uQhj5iwd0QRDVPnXKDMfbThCBgTV5DdnACywOU8lidCBbLztV1tKi pktH8uT2gujRvl2DRnOT7kmB0LZtnT4kNEWjKpMJ0f8h9e4mSuIZRTyYrFUt0t5SMA6mFZ Zt0GWRl5UPHAX8F57B8rh8Y5f65BnsU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-EoC4g_8zOua2OZPSM_BYpA-1; Tue, 04 Feb 2020 02:13:56 -0500 X-MC-Unique: EoC4g_8zOua2OZPSM_BYpA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A4D5801E6C for ; Tue, 4 Feb 2020 07:13:55 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20B325C1D4; Tue, 4 Feb 2020 07:13:53 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com Subject: [kvm-unit-tests PULL 8/9] gitlab-ci.yml: Remove ioapic from the x86 tests Date: Tue, 4 Feb 2020 08:13:34 +0100 Message-Id: <20200204071335.18180-9-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The test recently started to fail (likely do to a recent change to "x86/ioapic.c). According to Nitesh, it's not required to keep this test running with TCG, and we already check it with KVM on Travis, so let's simply disable it here now. Message-Id: <20191205151610.19299-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cf3264d..3093239 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,7 +64,7 @@ build-x86_64: - ./configure --arch=x86_64 - make -j2 - ACCEL=tcg ./run_tests.sh - ioapic-split ioapic smptest smptest3 vmexit_cpuid vmexit_mov_from_cr8 + smptest smptest3 vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_inl_pmtimer vmexit_ipi vmexit_ipi_halt vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed eventinj msr port80 setjmp syscall tsc rmap_chain umip intel_iommu From patchwork Tue Feb 4 07:13:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11364135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AC0613A4 for ; Tue, 4 Feb 2020 07:14:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FD112166E for ; Tue, 4 Feb 2020 07:14:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LnCPc9gO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727237AbgBDHOE (ORCPT ); Tue, 4 Feb 2020 02:14:04 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:49235 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727286AbgBDHOD (ORCPT ); Tue, 4 Feb 2020 02:14:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580800442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=JYiRtRvpBRR1lSpvsT6uq7BwYvk8CgobihKz7X3F0/Q=; b=LnCPc9gOpvliVmiOS/HvxNmHONLksxLmTDRscnS/pE7yGNr2RtFE8owGMKqr6C1XeGE6Ti z19eSO0ixOoQ39S4io3EDbK3zGCF3dVu2kENsWXB/Dbj14YC3537I3Wz7eR+VMAJ+iZ87I OkQ9aAiBCuii9KZK+3R3fGeYwq0BPWA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-4Dzz6PP0NwiRomkKiu3ZAg-1; Tue, 04 Feb 2020 02:14:00 -0500 X-MC-Unique: 4Dzz6PP0NwiRomkKiu3ZAg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4415C1090780 for ; Tue, 4 Feb 2020 07:13:59 +0000 (UTC) Received: from thuth.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89AF45C1D4; Tue, 4 Feb 2020 07:13:55 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: david@redhat.com, Wainer dos Santos Moschetta Subject: [kvm-unit-tests PULL 9/9] travis.yml: Prevent 'script' from premature exit Date: Tue, 4 Feb 2020 08:13:35 +0100 Message-Id: <20200204071335.18180-10-thuth@redhat.com> In-Reply-To: <20200204071335.18180-1-thuth@redhat.com> References: <20200204071335.18180-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Wainer dos Santos Moschetta The 'script' section finishes its execution prematurely whenever a shell's exit is called. If the intention is to force Travis to flag a build/test failure then the correct approach is erroring any command statement. In this change, it combines the grep's in a single AND statement that in case of false Travis will interpret as a build error. Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20200115144610.41655-1-wainersm@redhat.com> Signed-off-by: Thomas Huth --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 091d071..f0cfc82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -119,5 +119,4 @@ before_script: script: - make -j3 - ACCEL="${ACCEL:-tcg}" ./run_tests.sh -v $TESTS | tee results.txt - - if grep -q FAIL results.txt ; then exit 1 ; fi - - if ! grep -q PASS results.txt ; then exit 1 ; fi + - grep -q PASS results.txt && ! grep -q FAIL results.txt