From patchwork Wed Dec 11 09:42:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11284587 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 8A47F138D for ; Wed, 11 Dec 2019 09:42:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F921214D8 for ; Wed, 11 Dec 2019 09:42:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Pq5VyOlx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728653AbfLKJmc (ORCPT ); Wed, 11 Dec 2019 04:42:32 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:48927 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728590AbfLKJmc (ORCPT ); Wed, 11 Dec 2019 04:42:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576057351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R3qlUCV9KAzTRD5BLeh8Hw9oSDfU4THuhXKb8NvAbCk=; b=Pq5VyOlxmfWEfWw3z/Rw3qYSCO/QaT4aLWEZeKb7f4SrRztX6TwBgeGzhLO7F+JVxO51US 6rb6Hwb0QiP9jums+Ceczz9nLuBCRjxJbdXqttBGbwrYgj6FyibEcsn2AhhqAiscO6YeAO 6RjIeW1ePcNEIoujIB6eXgv6gNm0JqQ= 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-180-RmA6yfBXPnC75X-WRRUQ3g-1; Wed, 11 Dec 2019 04:42:28 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85D67800D4C for ; Wed, 11 Dec 2019 09:42:27 +0000 (UTC) Received: from thuth.com (ovpn-117-11.ams2.redhat.com [10.36.117.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7AFB763629; Wed, 11 Dec 2019 09:42:26 +0000 (UTC) From: Thomas Huth To: Paolo Bonzini , kvm@vger.kernel.org Cc: Drew Jones Subject: [kvm-unit-tests PATCH 1/4] scripts: Fix premature_failure() check with newer versions of QEMU Date: Wed, 11 Dec 2019 10:42:18 +0100 Message-Id: <20191211094221.7030-2-thuth@redhat.com> In-Reply-To: <20191211094221.7030-1-thuth@redhat.com> References: <20191211094221.7030-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: RmA6yfBXPnC75X-WRRUQ3g-1 X-Mimecast-Spam-Score: 0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org QEMU recently changed its output if it could not open a kernel file from "could not load kernel ..." to "could not open kernel ...", see QEMU commit 350f5233d755 ("hw/i386/pc: avoid an assignment in if condition in x86_load_linux()"). Thus we have to adapt our script that looks for this string accordingly. Signed-off-by: Thomas Huth --- scripts/runtime.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index fbad0bd..eb60890 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -18,7 +18,7 @@ premature_failure() local log="$(eval $(get_cmdline _NO_FILE_4Uhere_) 2>&1)" echo "$log" | grep "_NO_FILE_4Uhere_" | - grep -q -e "could not load kernel" -e "error loading" && + grep -q -e "could not \(load\|open\) kernel" -e "error loading" && return 1 RUNTIME_log_stderr <<< "$log" From patchwork Wed Dec 11 09:42:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11284589 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 4D62914BD for ; Wed, 11 Dec 2019 09:42:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23C7021556 for ; Wed, 11 Dec 2019 09:42:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Voj3TF2I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728624AbfLKJmc (ORCPT ); Wed, 11 Dec 2019 04:42:32 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:25231 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727888AbfLKJmc (ORCPT ); Wed, 11 Dec 2019 04:42:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576057351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r9bnY0jHRcMWSnryCKwgblqBO5XHvZ1/TSPstgKyozo=; b=Voj3TF2IG1Pqe6gaYmK2aVi4cyPmBSpU9vEcgWtfdX1f7fTtFOuAzLy0oMtXciggrV2+/d yyRP4EjGGfYzicxdTCH+1ZUXKNI2BVb1sJTaoXJgbFBQNedzzQQat9vQ6QNz8sUHkDmVcL VUThAKT4Wll2k26fG7Lz932O2qPcwcs= 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-78-0b-UkEbQOGW9renaceHYrQ-1; Wed, 11 Dec 2019 04:42:29 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D737A107BAA9 for ; Wed, 11 Dec 2019 09:42:28 +0000 (UTC) Received: from thuth.com (ovpn-117-11.ams2.redhat.com [10.36.117.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAA0963629; Wed, 11 Dec 2019 09:42:27 +0000 (UTC) From: Thomas Huth To: Paolo Bonzini , kvm@vger.kernel.org Cc: Drew Jones Subject: [kvm-unit-tests PATCH 2/4] x86: Fix coding style in setjmp.c Date: Wed, 11 Dec 2019 10:42:19 +0100 Message-Id: <20191211094221.7030-3-thuth@redhat.com> In-Reply-To: <20191211094221.7030-1-thuth@redhat.com> References: <20191211094221.7030-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: 0b-UkEbQOGW9renaceHYrQ-1 X-Mimecast-Spam-Score: 0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org No functional change, just use tabs for indentation. Signed-off-by: Thomas Huth --- x86/setjmp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/x86/setjmp.c b/x86/setjmp.c index 1874944..1a848b4 100644 --- a/x86/setjmp.c +++ b/x86/setjmp.c @@ -9,18 +9,18 @@ static const int expected[] = { int main(void) { - volatile int index = 0; - jmp_buf j; - int i; + volatile int index = 0; + jmp_buf j; + int i; - i = setjmp(j); - if (expected[index] != i) { - printf("FAIL: actual %d / expected %d\n", i, expected[index]); - return -1; - } - index++; - if (i + 1 < NUM_LONGJMPS) - longjmp(j, i + 1); + i = setjmp(j); + if (expected[index] != i) { + printf("FAIL: actual %d / expected %d\n", i, expected[index]); + return -1; + } + index++; + if (i + 1 < NUM_LONGJMPS) + longjmp(j, i + 1); - return 0; + return 0; } From patchwork Wed Dec 11 09:42:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11284591 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 9D7246C1 for ; Wed, 11 Dec 2019 09:42:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BB3621556 for ; Wed, 11 Dec 2019 09:42:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fHmQQedx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728527AbfLKJme (ORCPT ); Wed, 11 Dec 2019 04:42:34 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:42081 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728659AbfLKJmd (ORCPT ); Wed, 11 Dec 2019 04:42:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576057352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1LhOOoPGKMazwl4OGuPMhW4iUHPzm/SjdLULhvaPxsU=; b=fHmQQedxjEmGEPAqLo5NEXB3dtcZeGi79PtjwdT9ZQA6DWcx8j7JlZrfQEHQVnS1BwxAPQ Mxw2/gTJkwpb8tZbBTY3MipMI2U/evGgvBAtG4tqbGKVY1pftWdIWKV6MLLtDwGR01yLQZ sKIBFSu4lCal03zndhNiRj5vjJjfnPw= 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-102-rbJwqoaYNfuhaHaeqpbiMw-1; Wed, 11 Dec 2019 04:42:31 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C7238024D6 for ; Wed, 11 Dec 2019 09:42:30 +0000 (UTC) Received: from thuth.com (ovpn-117-11.ams2.redhat.com [10.36.117.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40D406364A; Wed, 11 Dec 2019 09:42:29 +0000 (UTC) From: Thomas Huth To: Paolo Bonzini , kvm@vger.kernel.org Cc: Drew Jones Subject: [kvm-unit-tests PATCH 3/4] x86: Add the setjmp test to the CI Date: Wed, 11 Dec 2019 10:42:20 +0100 Message-Id: <20191211094221.7030-4-thuth@redhat.com> In-Reply-To: <20191211094221.7030-1-thuth@redhat.com> References: <20191211094221.7030-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: rbJwqoaYNfuhaHaeqpbiMw-1 X-Mimecast-Spam-Score: 0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Use a proper report() in the test instead of printf(), and add it to the unittests.cfg and the CI yaml files. Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 4 ++-- .travis.yml | 4 ++-- x86/setjmp.c | 8 +++----- x86/unittests.cfg | 3 +++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbf3328..ea1aeaf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,7 +67,7 @@ build-x86_64: ioapic-split ioapic 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 syscall tsc rmap_chain umip intel_iommu + eventinj msr port80 setjmp syscall tsc rmap_chain umip intel_iommu | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi @@ -77,6 +77,6 @@ build-i386: - ./configure --arch=i386 - make -j2 - ACCEL=tcg ./run_tests.sh - eventinj port80 sieve tsc taskswitch taskswitch2 umip + eventinj port80 setjmp sieve tsc taskswitch taskswitch2 umip | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi diff --git a/.travis.yml b/.travis.yml index 75bcf08..53f8d7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ matrix: - BUILD_DIR="." - TESTS="access asyncpf debug emulator ept hypercall hyperv_stimer hyperv_synic idt_test intel_iommu ioapic ioapic-split - kvmclock_test msr pcid rdpru realmode rmap_chain s3 umip" + kvmclock_test msr pcid rdpru realmode rmap_chain s3 setjmp umip" - ACCEL="kvm" - addons: @@ -45,7 +45,7 @@ matrix: - BUILD_DIR="i386-builddir" - TESTS="tsx-ctrl umip vmexit_cpuid vmexit_ipi vmexit_ipi_halt vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ple_round_robin - vmexit_tscdeadline vmexit_tscdeadline_immed vmexit_vmcall" + vmexit_tscdeadline vmexit_tscdeadline_immed vmexit_vmcall setjmp" - ACCEL="kvm" - addons: diff --git a/x86/setjmp.c b/x86/setjmp.c index 1a848b4..cc411cd 100644 --- a/x86/setjmp.c +++ b/x86/setjmp.c @@ -14,13 +14,11 @@ int main(void) int i; i = setjmp(j); - if (expected[index] != i) { - printf("FAIL: actual %d / expected %d\n", i, expected[index]); - return -1; - } + report(expected[index] == i, "actual %d == expected %d", + i, expected[index]); index++; if (i + 1 < NUM_LONGJMPS) longjmp(j, i + 1); - return 0; + return report_summary(); } diff --git a/x86/unittests.cfg b/x86/unittests.cfg index e99b086..acdde10 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -171,6 +171,9 @@ file = realmode.flat [s3] file = s3.flat +[setjmp] +file = setjmp.flat + [sieve] file = sieve.flat timeout = 180 From patchwork Wed Dec 11 09:42:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11284593 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 B223B138D for ; Wed, 11 Dec 2019 09:42:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 905FD214D8 for ; Wed, 11 Dec 2019 09:42:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GcMdXq73" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728692AbfLKJmg (ORCPT ); Wed, 11 Dec 2019 04:42:36 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:28980 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728605AbfLKJmf (ORCPT ); Wed, 11 Dec 2019 04:42:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576057354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kVF+fz1ywtiAYHxQZ2KvFTuGKQt/bQcp8p2wEMicvdo=; b=GcMdXq73EAxOSZkhSRnP/H+jn6k7a6a4pIqdxs65O7bJ94P+bfghbbgNdwCrL8eJI4coAb NM2DdM+IdkL/0A0dx98RV47w22EfnQPoxbG/k3pfyu5Yks66f1zaPV7/NJmr+EhciGa1T1 zMJVpz2yWGToSxS0YP+11hc3bS8S880= 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-219-zTJgb5QKPvmALwIzM7kvOg-1; Wed, 11 Dec 2019 04:42:32 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CA7C1005510 for ; Wed, 11 Dec 2019 09:42:31 +0000 (UTC) Received: from thuth.com (ovpn-117-11.ams2.redhat.com [10.36.117.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB5B463629; Wed, 11 Dec 2019 09:42:30 +0000 (UTC) From: Thomas Huth To: Paolo Bonzini , kvm@vger.kernel.org Cc: Drew Jones Subject: [kvm-unit-tests PATCH 4/4] x86: Add the cmpxchg8b test to the CI Date: Wed, 11 Dec 2019 10:42:21 +0100 Message-Id: <20191211094221.7030-5-thuth@redhat.com> In-Reply-To: <20191211094221.7030-1-thuth@redhat.com> References: <20191211094221.7030-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: zTJgb5QKPvmALwIzM7kvOg-1 X-Mimecast-Spam-Score: 0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add an entry for this test to the unittests.cfg file and enable it in the CI pipelines. Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 2 +- .travis.yml | 2 +- x86/unittests.cfg | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ea1aeaf..67f7d80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,6 +77,6 @@ build-i386: - ./configure --arch=i386 - make -j2 - ACCEL=tcg ./run_tests.sh - eventinj port80 setjmp sieve tsc taskswitch taskswitch2 umip + cmpxchg8b eventinj port80 setjmp sieve tsc taskswitch taskswitch2 umip | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi diff --git a/.travis.yml b/.travis.yml index 53f8d7d..091d071 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ matrix: env: - CONFIG="--arch=i386" - BUILD_DIR="i386-builddir" - - TESTS="tsx-ctrl umip vmexit_cpuid vmexit_ipi vmexit_ipi_halt + - TESTS="cmpxchg8b tsx-ctrl umip vmexit_cpuid vmexit_ipi vmexit_ipi_halt vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed vmexit_vmcall setjmp" - ACCEL="kvm" diff --git a/x86/unittests.cfg b/x86/unittests.cfg index acdde10..51e4ba5 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -49,6 +49,10 @@ smp = 4 extra_params = -cpu qemu64 arch = x86_64 +[cmpxchg8b] +file = cmpxchg8b.flat +arch = i386 + [smptest] file = smptest.flat smp = 2