Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37993888rwd; Wed, 12 Jul 2023 01:14:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6v0oXqF9oikDAo9fRRT8bdEGdI3zbWuHRrj8Vu+GqlOr8pcEu2v2OHsFb0utEonXb3Xy1 X-Received: by 2002:a05:6358:7e06:b0:134:d026:42d2 with SMTP id o6-20020a0563587e0600b00134d02642d2mr13643530rwm.24.1689149682231; Wed, 12 Jul 2023 01:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689149682; cv=none; d=google.com; s=arc-20160816; b=j+PJRxvANx5nmmp0AULYj5Y0zYQe/PBwC8/A3vzqLnx41VRqwBpj7soGRU96R/TF30 Le7qzFwdRHGGZTGBxWloKXGRMqpm9biSXrMSHAWfXRw/00PCoTe+xZ4pugwtvO2zbbmS E32WJ3oD3Ag+aE8n9fOBl4btWBL2e30SvRGhu4JrO3QlQsfsKGze3HtCnLrdhqLNbdql 6kq1zu0Ma7AFBsHc1aFgUxv/zDRFuUgtydg5chHD94iV/UrRyiPM+ENYY0vlGyxxBmlr vIjJ65DiXHhrit8F3xK+vQsq/CkR+IEAPvR9nu4v/iSq2haagx3grB5juJ6L5A3z+t4D YnEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hgo9YuUU2jqiHTi7UEl9pw/Cu7nUbHUeFZMun2ueh0k=; fh=CoqLVoHqzprQiJNt8WDryjpq4BuBxl6+dCSpUOnVgUQ=; b=Z/JJF/pWczEYZsFh/IOtEq99kFlN+bIpM7wXn5zTS4WKZYrayAt2GSW3IQoafbw7MX SdMaxaL2HF9dAxtPAUyoT6JgCB7VDuc1SBq1icobj5ap/K8H66iowgHj9X/2fn0V/lOl YX1DeyS3SJ8Psth1qNBlMetugECeOh17607kIUAtoygjhMw0+oe41n7FAraabG1vEDiV 90SocE4hOk1NUxXWdHwOCzwxZzmmsWp6X2NLgLvE/YH0K8nlCKBscOWfNZQR98ikmfBJ aQbfhfcBhuOB5oQEOX8dC1oDHSk4sNW4pWh5//GlyCEnfHcwAOuzVBIVhhbtCx4GtVZ+ yr8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Hha/pPzi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m128-20020a632686000000b0053fb354c194si2926888pgm.659.2023.07.12.01.14.30; Wed, 12 Jul 2023 01:14:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Hha/pPzi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbjGLIAK (ORCPT + 99 others); Wed, 12 Jul 2023 04:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjGLIAI (ORCPT ); Wed, 12 Jul 2023 04:00:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6649519B4 for ; Wed, 12 Jul 2023 00:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689148763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hgo9YuUU2jqiHTi7UEl9pw/Cu7nUbHUeFZMun2ueh0k=; b=Hha/pPzip5tW473B9u6kl/7Tovl77U0H0NK4X69X4pu7NAoY2ctZ7/ncY09exwndoDXOFK 8i2/bBMxcA/QhAQn6Yxj8C0/p4VQ+T2IBSCipitbqdtLLRCOrkuzk/hBK+mO1NsoxzcpU8 UE/7svSdcEd9ESWrPRQemuJ3/Jg6Phk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-178-7NJDwfmRMBCQ48jNY0ihQQ-1; Wed, 12 Jul 2023 03:59:19 -0400 X-MC-Unique: 7NJDwfmRMBCQ48jNY0ihQQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E8358EBBA6; Wed, 12 Jul 2023 07:59:19 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA7B4492C13; Wed, 12 Jul 2023 07:59:17 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Sean Christopherson Cc: linux-kselftest@vger.kernel.org, David Matlack Subject: [PATCH 3/4] KVM: selftests: x86: Use TAP interface in the fix_hypercall test Date: Wed, 12 Jul 2023 09:59:09 +0200 Message-Id: <20230712075910.22480-4-thuth@redhat.com> In-Reply-To: <20230712075910.22480-1-thuth@redhat.com> References: <20230712075910.22480-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/fix_hypercall_test.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c index 0f728f05ea82f..7621942a072ec 100644 --- a/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c +++ b/tools/testing/selftests/kvm/x86_64/fix_hypercall_test.c @@ -9,6 +9,7 @@ #include #include +#include "kselftest_harness.h" #include "apic.h" #include "test_util.h" #include "kvm_util.h" @@ -126,10 +127,19 @@ static void test_fix_hypercall(bool disable_quirk) enter_guest(vcpu); } -int main(void) +TEST(fix_hypercall) { - TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) & KVM_X86_QUIRK_FIX_HYPERCALL_INSN); - test_fix_hypercall(false); +} + +TEST(fix_hypercall_disable_quirk) +{ test_fix_hypercall(true); } + +int main(int argc, char *argv[]) +{ + TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) & KVM_X86_QUIRK_FIX_HYPERCALL_INSN); + + return test_harness_run(argc, argv); +} -- 2.39.3