From patchwork Wed May 11 16:12:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9072611 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 60BB1BF29F for ; Wed, 11 May 2016 16:13:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76A542017D for ; Wed, 11 May 2016 16:13:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B17E20155 for ; Wed, 11 May 2016 16:13:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932300AbcEKQNP (ORCPT ); Wed, 11 May 2016 12:13:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40569 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932165AbcEKQNO (ORCPT ); Wed, 11 May 2016 12:13:14 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B032C0C237C for ; Wed, 11 May 2016 16:13:14 +0000 (UTC) Received: from potion (dhcp-1-215.brq.redhat.com [10.34.1.215]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u4BGDB9o029675; Wed, 11 May 2016 12:13:12 -0400 Received: by potion (sSMTP sendmail emulation); Wed, 11 May 2016 18:13:11 +0200 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: kvm@vger.kernel.org Cc: Paolo Bonzini , Andrew Jones Subject: [kvm-unit-tests PATCH v4 02/13] x86/*: report skipped tests Date: Wed, 11 May 2016 18:12:44 +0200 Message-Id: <1462983171-4208-3-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> References: <1462983171-4208-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 11 May 2016 16:13:14 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No care to consistency or exhaustivity was given. Drew pointed out that tscdeadline_latency.c doesn't report skipped tests. tscdeadline_latency needs complete refactoring and is not run with ./run_tests, so I ignored it. Signed-off-by: Radim Kr?má? --- v4: explained the reason behind ignoring v3 review x86/apic.c | 7 +++---- x86/emulator.c | 2 +- x86/hyperv_synic.c | 2 +- x86/pku.c | 2 +- x86/pmu.c | 2 +- x86/smap.c | 2 +- x86/svm.c | 2 +- x86/tsc.c | 2 +- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/x86/apic.c b/x86/apic.c index 61a0a7659805..8b08a950a0c7 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -27,7 +27,7 @@ static void tsc_deadline_timer_isr(isr_regs_t *regs) ++tdt_count; } -static void start_tsc_deadline_timer(void) +static void __test_tsc_deadline_timer(void) { handle_irq(TSC_DEADLINE_TIMER_VECTOR, tsc_deadline_timer_isr); irq_enable(); @@ -45,7 +45,6 @@ static int enable_tsc_deadline_timer(void) if (cpuid(1).c & (1 << 24)) { lvtt = TSC_DEADLINE_TIMER_MODE | TSC_DEADLINE_TIMER_VECTOR; apic_write(APIC_LVTT, lvtt); - start_tsc_deadline_timer(); return 1; } else { return 0; @@ -55,9 +54,9 @@ static int enable_tsc_deadline_timer(void) static void test_tsc_deadline_timer(void) { if(enable_tsc_deadline_timer()) { - printf("tsc deadline timer enabled\n"); + __test_tsc_deadline_timer(); } else { - printf("tsc deadline timer not detected\n"); + report_skip("tsc deadline timer not detected"); } } diff --git a/x86/emulator.c b/x86/emulator.c index 3730721258bc..8d262d832112 100644 --- a/x86/emulator.c +++ b/x86/emulator.c @@ -1082,7 +1082,7 @@ static void illegal_movbe_handler(struct ex_regs *regs) static void test_illegal_movbe(void) { if (!(cpuid(1).c & (1 << 22))) { - printf("SKIP: illegal movbe\n"); + report_skip("illegal movbe"); return; } diff --git a/x86/hyperv_synic.c b/x86/hyperv_synic.c index 6e088944be1f..f5eb82bb7336 100644 --- a/x86/hyperv_synic.c +++ b/x86/hyperv_synic.c @@ -202,7 +202,7 @@ int main(int ac, char **av) report("Hyper-V SynIC test", ok); } else { - report("Hyper-V SynIC is not supported", true); + report_skip("Hyper-V SynIC is not supported"); } return report_summary(); diff --git a/x86/pku.c b/x86/pku.c index df51d1b59048..6214f0bc151f 100644 --- a/x86/pku.c +++ b/x86/pku.c @@ -68,7 +68,7 @@ int main(int ac, char **av) if (!(cpuid_indexed(7, 0).c & (1 << X86_FEATURE_PKU))) { printf("PKU not enabled, aborting\n"); - abort(); + return report_summary(); } setup_vm(); diff --git a/x86/pmu.c b/x86/pmu.c index 03f80190bb25..c68980044dee 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -387,7 +387,7 @@ int main(int ac, char **av) if (!eax.split.version_id) { printf("No pmu is detected!\n"); - return 1; + return report_summary(); } printf("PMU version: %d\n", eax.split.version_id); printf("GP counters: %d\n", eax.split.num_counters); diff --git a/x86/smap.c b/x86/smap.c index 69e71864dc9b..c9de081a474b 100644 --- a/x86/smap.c +++ b/x86/smap.c @@ -93,7 +93,7 @@ int main(int ac, char **av) if (!(cpuid_indexed(7, 0).b & (1 << X86_FEATURE_SMAP))) { printf("SMAP not enabled, aborting\n"); - abort(); + return report_summary(); } setup_vm(); diff --git a/x86/svm.c b/x86/svm.c index 934b2ae91fa8..301cf8cb2d6b 100644 --- a/x86/svm.c +++ b/x86/svm.c @@ -1064,7 +1064,7 @@ int main(int ac, char **av) if (!(cpuid(0x80000001).c & 4)) { printf("SVM not availble\n"); - return 0; + return report_summary(); } setup_svm(); diff --git a/x86/tsc.c b/x86/tsc.c index 6f89c911c2bc..62450e71725c 100644 --- a/x86/tsc.c +++ b/x86/tsc.c @@ -43,5 +43,5 @@ int main() test_rdtscp(0x100); } else printf("rdtscp not supported\n"); - return 0; + return report_summary(); }