Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp361756rdb; Thu, 5 Oct 2023 08:04:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvZfYSTCUxQM/hgnuGtdnT6OTYrDcZnOCuK3wCHSBuW34r5StjSTZHJmZ2yhu0etflY2Lu X-Received: by 2002:aa7:8889:0:b0:691:1eb:7dda with SMTP id z9-20020aa78889000000b0069101eb7ddamr5900015pfe.7.1696518286934; Thu, 05 Oct 2023 08:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696518286; cv=none; d=google.com; s=arc-20160816; b=PE5AVxKk+INDjJ8i9GeTfu2Z6sRWQC/CD8jeY70vHQOUrJkOT3vUgCZ2uSk3gzuCJ7 Qk6S/CkNUuaaxuQ3wouTfWsQLxyrVEjfqDPpNOjECp0qqurCOx7eEZOI/7JtYjWRWE7y CIrysX/EaMILXdPlyDZifXF34xYCu7hsWvpysCy8Yk3qVFfXtqvcWTvebyTP/AxlZqBH 7/SLk4mc9eF0/kiQo9hPtNvLHYG0MJ2gTAjJ/49o9kbbRitD8OCzrLX4h7UwzJapZqYc Fa9mCRdHxe6VrmEAJEnZ24ND7SmuUUTADWWdqxS6gbpDqHijbuxgBo+30VAoV09yDTOe qrbw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Dv/Tj9QdaUN/Br120dwAsxWiHl/rp7FzLwgEPtUXlX4=; fh=WOoc99rHeo9qxHvnIaWffALNRebT/42m1dldSuRpBY0=; b=XaGrl/p6/UbG1N+U4yMUNyt8rXQWMqQJ0ZdiybZk+6Ipsw2pR+p38a7L1lM+7PhZDz /JFndI6If1IA3pBhe1UAKCDLPsLpPgBqJLJaeRusEbMdoEGNvkzgX5Alf4zBVjsSFBnL RhaHZTbRBVTDIHS30T0BnEgtSbwcpznEvoU2DJG2PPE0ANQkpnDyYZIn62G9rU6R0ouA S3kNG2wHuLxVfBgkXQEetbAN0lyx0Me+n+a4CaIvSn6fZMO7157v0W5eav91QzcZnRtD t9caq7BDb+mLfw7YQgjqJT5CKHMBsW3EeJIC6CfzxCsVgA34iU+n4GsTXJACbac0bLji P1Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xbafz0v0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l26-20020a65681a000000b00578af607626si1568677pgt.668.2023.10.05.08.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xbafz0v0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4B02480236C6; Thu, 5 Oct 2023 08:04:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbjJEPDx (ORCPT + 99 others); Thu, 5 Oct 2023 11:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjJEPCu (ORCPT ); Thu, 5 Oct 2023 11:02:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4463C3B for ; Thu, 5 Oct 2023 07:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696516726; 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; bh=Dv/Tj9QdaUN/Br120dwAsxWiHl/rp7FzLwgEPtUXlX4=; b=Xbafz0v0wTrf2GldfY8ciILeWNoOtZ35zZoo6/f1z2PCnpAaK5stPktlLRQDiRuaZ0GIfQ xS2qcJNSJZgJ/KMX0+094ew3FB21oS+8DrB/LqPrh01F/5hdEBrQmHPjx4Ar5tPXfPAj7Y FxSZAGTPXA7TRdz8EIb8/wRiNOv6lCo= 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-487-JabyE1AROsuedgPQHMod8A-1; Thu, 05 Oct 2023 10:38:42 -0400 X-MC-Unique: JabyE1AROsuedgPQHMod8A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4DDC8803498; Thu, 5 Oct 2023 14:38:42 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C9F940C6EA8; Thu, 5 Oct 2023 14:38:40 +0000 (UTC) From: Thomas Huth To: Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 0/7] Use TAP in some more x86 KVM selftests Date: Thu, 5 Oct 2023 16:38:32 +0200 Message-ID: <20231005143839.365297-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:04:44 -0700 (PDT) Here's a follow-up from my RFC series last year: https://lore.kernel.org/lkml/20221004093131.40392-1-thuth@redhat.com/T/ and from v1 earlier this year: https://lore.kernel.org/kvm/20230712075910.22480-1-thuth@redhat.com/ Basic idea of this series is now to use the kselftest_harness.h framework to get TAP output in the tests, so that it is easier for the user to see what is going on, and e.g. to be able to detect whether a certain test is part of the test binary or not (which is useful when tests get extended in the course of time). v2: - Dropped the "Rename the ASSERT_EQ macro" patch (already merged) - Split the fixes in the sync_regs_test into separate patches (see the first two patches) - Introduce the KVM_ONE_VCPU_TEST_SUITE() macro as suggested by Sean (see third patch) and use it in the following patches - Add a new patch to convert vmx_pmu_caps_test.c, too Thomas Huth (7): KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it KVM: selftests: Add a macro to define a test with one vcpu KVM: selftests: x86: Use TAP interface in the sync_regs test KVM: selftests: x86: Use TAP interface in the fix_hypercall test KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps test KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test .../selftests/kvm/include/kvm_test_harness.h | 35 +++++ .../selftests/kvm/x86_64/fix_hypercall_test.c | 27 ++-- .../selftests/kvm/x86_64/sync_regs_test.c | 121 +++++++++++++----- .../kvm/x86_64/userspace_msr_exit_test.c | 19 +-- .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 50 ++------ 5 files changed, 160 insertions(+), 92 deletions(-) create mode 100644 tools/testing/selftests/kvm/include/kvm_test_harness.h -- 2.41.0