From patchwork Wed Jul 12 07:59:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp984962vqm; Wed, 12 Jul 2023 01:04:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFEhv0f66nq5dn28W79HurqqvRkTfgxh083Int5uApkdBsoePwJuMVKqbkXr6CfCI/4+2j7 X-Received: by 2002:aa7:d741:0:b0:51d:f37c:e3b8 with SMTP id a1-20020aa7d741000000b0051df37ce3b8mr18182287eds.13.1689149095535; Wed, 12 Jul 2023 01:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689149095; cv=none; d=google.com; s=arc-20160816; b=pmADmZTg68T9/rWkPTRpj8dt0xKHvRNtGvUd4kR9qpfgg6o6NtMnwwalkXRiAlmTZX Gg7TgJHeCCinCZFjdqE81a625zDc8FGcP2dLDancvNAhA0FVXcALPQNQxSjAjrsBPx4Q 6CQXE90s4ui0yLPirCktmGqjMeO4wnL4jj4erkOxbT49Ow3PRfqYFEAAoK8FjYrBwwzs zZC1hq6WjpZdMcvpxWk5cL4iP7QnyhboDJ5HJmQc49fGY3SvqXbmWaomAuwGFP2zwlKd dbNUDoKD5Ec31sqnICtmVCbk6lOucmVspYouiUPskPCgiGSIqljlBK3IX3aAZZBAzhZs 05Rw== 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=NFh1fy7H4rVXbuwjJ23VCR8o/98dOivY4sK9jDopnVk=; fh=CoqLVoHqzprQiJNt8WDryjpq4BuBxl6+dCSpUOnVgUQ=; b=cQrlRSOIPVZyuFL9xdA25a0APMJa0Q7EIPnrRe5v2JJGtNLu0zQPPlxapBKqprRJLW CmR/afRBjQ2Yl88SBPzxi8fl9GwZUKvEsJk8FbrxIn9j4X6HrLeO55stJlFsob/X7RcD ZktdIymuFG6UEt39f5fdeg2e64GktMvRWCIjNqqLvfL93C/UQnJ4z9UBxbXAO5JSjetc KRCJJcT5qKNjkUov29G4/DWuV6KWqqZj6EU7KpJ0FubMLoyptyyJsNww/YaVKeh+W3PT LTmOSXmPPkcL8IJuHMHEOefWi9U0sAIKmKkvWvTjdFq6zeLnrDCD34EwJG1cyw3Fujmv k8iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CwZLS9aS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020aa7d5c4000000b0051da2632d0dsi4386803eds.553.2023.07.12.01.04.32; Wed, 12 Jul 2023 01:04:55 -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=CwZLS9aS; 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 S231767AbjGLIAF (ORCPT + 99 others); Wed, 12 Jul 2023 04:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230472AbjGLIAD (ORCPT ); Wed, 12 Jul 2023 04:00:03 -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 A7DE110E5 for ; Wed, 12 Jul 2023 00:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689148755; 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=NFh1fy7H4rVXbuwjJ23VCR8o/98dOivY4sK9jDopnVk=; b=CwZLS9aShN402/t5fKtVuzG7NdVRROti/37TqCNzP5M+Or4FB1JLYEKxzRNC9Mp2LVPD/d BHwUMcN12mnlZXDr0K/R59Ta8AQa55Cv0V3MJ+Zg/jDkd+1IvUT6ol33LSblhtVyPom5PN VPWnQ31XtS67XsTWlW6PcZjQQh1xO4Q= 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-13-qQFCFb3RP5OIbUN2ltDXLg-1; Wed, 12 Jul 2023 03:59:14 -0400 X-MC-Unique: qQFCFb3RP5OIbUN2ltDXLg-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 29A548EBBA1; Wed, 12 Jul 2023 07:59:14 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97B90492C13; Wed, 12 Jul 2023 07:59:12 +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 0/4] Use TAP in some more x86 KVM selftests Date: Wed, 12 Jul 2023 09:59:06 +0200 Message-Id: <20230712075910.22480-1-thuth@redhat.com> MIME-Version: 1.0 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=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771201202221206746 X-GMAIL-MSGID: 1771201202221206746 Here's a follow-up from my RFC series last year: https://lore.kernel.org/lkml/20221004093131.40392-1-thuth@redhat.com/T/ 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). Thomas Huth (4): KVM: selftests: Rename the ASSERT_EQ macro 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 userspace_msr_exit test .../selftests/kvm/aarch64/aarch32_id_regs.c | 8 +- .../selftests/kvm/aarch64/page_fault_test.c | 10 +- .../testing/selftests/kvm/include/test_util.h | 4 +- tools/testing/selftests/kvm/lib/kvm_util.c | 2 +- .../selftests/kvm/max_guest_memory_test.c | 2 +- tools/testing/selftests/kvm/s390x/cmma_test.c | 62 +++++----- tools/testing/selftests/kvm/s390x/memop.c | 6 +- tools/testing/selftests/kvm/s390x/tprot.c | 4 +- .../x86_64/dirty_log_page_splitting_test.c | 18 +-- .../x86_64/exit_on_emulation_failure_test.c | 2 +- .../selftests/kvm/x86_64/fix_hypercall_test.c | 16 ++- .../kvm/x86_64/nested_exceptions_test.c | 12 +- .../kvm/x86_64/recalc_apic_map_test.c | 6 +- .../selftests/kvm/x86_64/sync_regs_test.c | 113 +++++++++++++++--- .../selftests/kvm/x86_64/tsc_msrs_test.c | 32 ++--- .../kvm/x86_64/userspace_msr_exit_test.c | 19 +-- .../vmx_exception_with_invalid_guest_state.c | 2 +- .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 3 +- .../selftests/kvm/x86_64/xapic_state_test.c | 8 +- .../selftests/kvm/x86_64/xen_vmcall_test.c | 20 ++-- 20 files changed, 218 insertions(+), 131 deletions(-)