From patchwork Tue Jun 26 10:01:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 934761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41FM5471hVz9s1R for ; Tue, 26 Jun 2018 20:01:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933948AbeFZKB1 (ORCPT ); Tue, 26 Jun 2018 06:01:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50332 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933870AbeFZKBZ (ORCPT ); Tue, 26 Jun 2018 06:01:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 924774067720; Tue, 26 Jun 2018 10:01:24 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-204-33.brq.redhat.com [10.40.204.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id F07032166B5D; Tue, 26 Jun 2018 10:01:22 +0000 (UTC) From: Thomas Huth To: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Paolo Bonzini , kvm@vger.kernel.org Cc: David Hildenbrand , Laurent Vivier , kvm-ppc@vger.kernel.org Subject: [kvm-unit-tests PULL 1/4] s390x: Report missing facilities as "skip", not as "expected failure" Date: Tue, 26 Jun 2018 12:01:16 +0200 Message-Id: <1530007279-26545-2-git-send-email-thuth@redhat.com> In-Reply-To: <1530007279-26545-1-git-send-email-thuth@redhat.com> References: <1530007279-26545-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 26 Jun 2018 10:01:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 26 Jun 2018 10:01:24 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Looking at the other architectures, I just recently learnt that it is better to mark missing CPU functionality as SKIP instead of reporting an expected failure. Thus let's replace the report_xfail() calls in the s390x code with report_skip(). Reviewed-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Farhan Ali Signed-off-by: Thomas Huth --- s390x/cmm.c | 5 +++-- s390x/gs.c | 5 +++-- s390x/iep.c | 5 +++-- s390x/pfmf.c | 5 +++-- s390x/sthyi.c | 5 +++-- s390x/vector.c | 15 +++++++++------ 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/s390x/cmm.c b/s390x/cmm.c index 9e6a193..42dfda2 100644 --- a/s390x/cmm.c +++ b/s390x/cmm.c @@ -57,9 +57,10 @@ int main(void) bool has_essa = test_availability(); report_prefix_push("cmm"); - report_xfail("ESSA available", !has_essa, has_essa); - if (!has_essa) + if (!has_essa) { + report_skip("ESSA is not available"); goto done; + } test_priv(); test_params(); diff --git a/s390x/gs.c b/s390x/gs.c index 0cba5dd..bddc2b4 100644 --- a/s390x/gs.c +++ b/s390x/gs.c @@ -158,9 +158,10 @@ int main(void) bool has_gs = test_facility(133); report_prefix_push("gs"); - report_xfail("Guarded storage available", !has_gs, has_gs); - if (!has_gs) + if (!has_gs) { + report_skip("Guarded storage is not available"); goto done; + } test_special(); init(); diff --git a/s390x/iep.c b/s390x/iep.c index e4abc72..8c1ea8f 100644 --- a/s390x/iep.c +++ b/s390x/iep.c @@ -48,9 +48,10 @@ int main(void) bool has_iep = test_facility(130); report_prefix_push("iep"); - report_xfail("DAT IEP available", !has_iep, has_iep); - if (!has_iep) + if (!has_iep) { + report_skip("DAT IEP is not available"); goto done; + } /* Setup DAT 1:1 mapping and memory management */ setup_vm(); diff --git a/s390x/pfmf.c b/s390x/pfmf.c index 838f7bd..2268fd0 100644 --- a/s390x/pfmf.c +++ b/s390x/pfmf.c @@ -125,9 +125,10 @@ int main(void) bool has_edat = test_facility(8); report_prefix_push("pfmf"); - report_xfail("PFMF available", !has_edat, has_edat); - if (!has_edat) + if (!has_edat) { + report_skip("PFMF is not available"); goto done; + } test_priv(); /* Force the buffer pages in */ diff --git a/s390x/sthyi.c b/s390x/sthyi.c index 0b1b4ec..16b8c14 100644 --- a/s390x/sthyi.c +++ b/s390x/sthyi.c @@ -150,9 +150,10 @@ int main(void) report_prefix_push("sthyi"); /* Test for availability */ - report_xfail("STHYI available", !has_sthyi, has_sthyi); - if (!has_sthyi) + if (!has_sthyi) { + report_skip("STHYI is not available"); goto done; + } /* Test register/argument checking. */ test_exception_addr(); diff --git a/s390x/vector.c b/s390x/vector.c index 05b3eca..d40f647 100644 --- a/s390x/vector.c +++ b/s390x/vector.c @@ -60,9 +60,10 @@ static void test_ext1_nand(void) __uint128_t a,b,c; } prm __attribute__((aligned(16))); - report_xfail("Vector extensions 1 available", !has_vext, has_vext); - if (!has_vext) + if (!has_vext) { + report_skip("Vector extensions 1 is not available"); return; + } memset(&prm, 0xff, sizeof(prm)); @@ -85,9 +86,10 @@ static void test_bcd_add(void) __uint128_t a,b,c; } prm __attribute__((aligned(16))); - report_xfail("Vector BCD extensions available", !has_bcd, has_bcd); - if (!has_bcd) + if (!has_bcd) { + report_skip("Vector BCD extensions is not available"); return; + } prm.c = 0; prm.a = prm.b = 0b001000011100; @@ -118,9 +120,10 @@ int main(void) bool has_vregs = test_facility(129); report_prefix_push("vector"); - report_xfail("Basic vector facility available", !has_vregs, has_vregs); - if (!has_vregs) + if (!has_vregs) { + report_skip("Basic vector facility is not available"); goto done; + } init(); test_add(); From patchwork Tue Jun 26 10:01:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 934762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41FM555rnYz9s5K for ; Tue, 26 Jun 2018 20:01:29 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933980AbeFZKB3 (ORCPT ); Tue, 26 Jun 2018 06:01:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932629AbeFZKB1 (ORCPT ); Tue, 26 Jun 2018 06:01:27 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92BE07A7E8; Tue, 26 Jun 2018 10:01:26 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-204-33.brq.redhat.com [10.40.204.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id E30DC2166B5D; Tue, 26 Jun 2018 10:01:24 +0000 (UTC) From: Thomas Huth To: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Paolo Bonzini , kvm@vger.kernel.org Cc: David Hildenbrand , Laurent Vivier , kvm-ppc@vger.kernel.org Subject: [kvm-unit-tests PULL 2/4] s390x: Remove .note.gnu.build-id section from the ELF files Date: Tue, 26 Jun 2018 12:01:17 +0200 Message-Id: <1530007279-26545-3-git-send-email-thuth@redhat.com> In-Reply-To: <1530007279-26545-1-git-send-email-thuth@redhat.com> References: <1530007279-26545-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 26 Jun 2018 10:01:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 26 Jun 2018 10:01:26 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org While debugging another problem, we noticed that the low memory contains some bytes which should not be there. Looks like the linker puts the ".note.gnu.build-id" section to address 0 if it has not explicitly specified in the linker script. ARM and powerpc unit tests are apparently already using --build-id=none to avoid this problem, so let's simply use this linker flag in the s390x builds, too. Reviewed-by: Janosch Frank Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- s390x/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/Makefile b/s390x/Makefile index d4275a1..6546a02 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -21,7 +21,7 @@ CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/s390x -I lib CFLAGS += -O2 CFLAGS += -march=z900 CFLAGS += -fno-delete-null-pointer-checks -LDFLAGS += -nostdlib +LDFLAGS += -nostdlib -Wl,--build-id=none # We want to keep intermediate files .PRECIOUS: %.o From patchwork Tue Jun 26 10:01:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 934764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41FM5F68gyz9s5b for ; Tue, 26 Jun 2018 20:01:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933994AbeFZKBa (ORCPT ); Tue, 26 Jun 2018 06:01:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39822 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933870AbeFZKB3 (ORCPT ); Tue, 26 Jun 2018 06:01:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EACB40201BE; Tue, 26 Jun 2018 10:01:28 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-204-33.brq.redhat.com [10.40.204.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE82B2166B5D; Tue, 26 Jun 2018 10:01:26 +0000 (UTC) From: Thomas Huth To: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Paolo Bonzini , kvm@vger.kernel.org Cc: David Hildenbrand , Laurent Vivier , kvm-ppc@vger.kernel.org Subject: [kvm-unit-tests PULL 3/4] Make the powerpc tests compilable with GCC 8 Date: Tue, 26 Jun 2018 12:01:18 +0200 Message-Id: <1530007279-26545-4-git-send-email-thuth@redhat.com> In-Reply-To: <1530007279-26545-1-git-send-email-thuth@redhat.com> References: <1530007279-26545-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 26 Jun 2018 10:01:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 26 Jun 2018 10:01:28 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org The new GCC 8.1 is optimizing the code with vector instructions. However, we have not turned on the vector extension in our kvm-unit-test code, so the tests crash when they hit such an instruction. Compile the unit tests without vector extensions to avoid this problem. Reviewed-by: Laurent Vivier Signed-off-by: Thomas Huth --- powerpc/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common index 63dc166..81c5074 100644 --- a/powerpc/Makefile.common +++ b/powerpc/Makefile.common @@ -19,7 +19,7 @@ all: directories $(TEST_DIR)/boot_rom.bin $(tests-all) CFLAGS += -std=gnu99 CFLAGS += -ffreestanding -CFLAGS += -O2 +CFLAGS += -O2 -msoft-float -mabi=no-altivec -mno-altivec CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib CFLAGS += -Wa,-mregnames From patchwork Tue Jun 26 10:01:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 934763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41FM5F144zz9s1R for ; Tue, 26 Jun 2018 20:01:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932629AbeFZKBc (ORCPT ); Tue, 26 Jun 2018 06:01:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57768 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933870AbeFZKBb (ORCPT ); Tue, 26 Jun 2018 06:01:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9B30F68A7; Tue, 26 Jun 2018 10:01:30 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-204-33.brq.redhat.com [10.40.204.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 067152166B5D; Tue, 26 Jun 2018 10:01:28 +0000 (UTC) From: Thomas Huth To: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Paolo Bonzini , kvm@vger.kernel.org Cc: David Hildenbrand , Laurent Vivier , kvm-ppc@vger.kernel.org Subject: [kvm-unit-tests PULL 4/4] powerpc: Report missing features as "skip", not as "expected failure" Date: Tue, 26 Jun 2018 12:01:19 +0200 Message-Id: <1530007279-26545-5-git-send-email-thuth@redhat.com> In-Reply-To: <1530007279-26545-1-git-send-email-thuth@redhat.com> References: <1530007279-26545-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 26 Jun 2018 10:01:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 26 Jun 2018 10:01:30 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Missing CPU or hypervisor features are not a real error, so we should rather report a "skip" here than an "expected failure". Signed-off-by: Thomas Huth --- powerpc/spapr_hcall.c | 6 ++++-- powerpc/tm.c | 26 ++++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/powerpc/spapr_hcall.c b/powerpc/spapr_hcall.c index ce495f4..524d896 100644 --- a/powerpc/spapr_hcall.c +++ b/powerpc/spapr_hcall.c @@ -118,9 +118,11 @@ static void test_h_random(int argc, char **argv) /* H_RANDOM is optional - so check for sane return values first */ rc = h_random(&rval); - report_xfail("h-call available", rc == H_FUNCTION, rc == H_SUCCESS); - if (rc != H_SUCCESS) + if (rc == H_FUNCTION) { + report_skip("h-call is not available"); return; + } + report("h-call can be used successfully", rc == H_SUCCESS); val0 = 0ULL; val1 = ~0ULL; diff --git a/powerpc/tm.c b/powerpc/tm.c index ff7b2f9..bd56baa 100644 --- a/powerpc/tm.c +++ b/powerpc/tm.c @@ -35,15 +35,17 @@ static void cpu_has_tm(int fdtnode, u64 regval __unused, void *ptr) *(int *)ptr += 1; } -/* Check whether all CPU nodes have the TM flag */ -static bool all_cpus_have_tm(void) +/* Check amount of CPUs nodes that have the TM flag */ +static int count_cpus_with_tm(void) { int ret; int available = 0; ret = dt_for_each_cpu_node(cpu_has_tm, &available); + if (ret < 0) + return ret; - return ret == 0 && available == nr_cpus; + return available; } static int h_cede(void) @@ -136,16 +138,18 @@ struct { int main(int argc, char **argv) { - bool all, has_tm; - int i; + bool all; + int i, cpus_with_tm; report_prefix_push("tm"); - has_tm = all_cpus_have_tm(); - report_xfail("TM available in 'ibm,pa-features' property", - !has_tm, has_tm); - if (!has_tm) - return report_summary(); + cpus_with_tm = count_cpus_with_tm(); + if (cpus_with_tm == 0) { + report_skip("TM is not available"); + goto done; + } + report("TM available in all 'ibm,pa-features' properties", + cpus_with_tm == nr_cpus); all = argc == 1 || !strcmp(argv[1], "all"); @@ -157,5 +161,7 @@ int main(int argc, char **argv) } } +done: + report_prefix_pop(); return report_summary(); }