Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1616739pxb; Thu, 14 Apr 2022 10:01:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMQKcZtM61oChDMu40BfNmcTXQNp4nF0uHCw2pV4o9zI6Ye1lb87zTgbhEOGoWwl9+vxjd X-Received: by 2002:a63:d149:0:b0:384:b288:8704 with SMTP id c9-20020a63d149000000b00384b2888704mr2986070pgj.112.1649955707201; Thu, 14 Apr 2022 10:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649955707; cv=none; d=google.com; s=arc-20160816; b=ixLovVN33YATb8EQFyWCi/xQlg6+kf53GP0ze6d/5JgvsdFX/k7VtlF/RQlvVwLnqO z5Z87fw99au3wz9jcxT5H0dAj9p9VkaHS05A30BCgqyFoeS+JbCxYxAnjAzI/IHkMnD2 qzNzziZRcNjG2NSwZ4ss/KnritWUDBONi1CU3iVL6ruGJ7mAnSaaPxRyifKV2Af+8ms4 8ui9QH5kPT7km9OO+N9dom8PrKxXobvp0vk+SQqFm73bqVj4Msp8b071pd6zCf3FtqnM CyyfstJNSjvbyP7hvg/0YMe4Cj31FjkllfJPaSEBXpGYNFY0NAfzyfyLrrtCFlhsXri0 2VFQ== 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=qezaIFsTkLoWKaonJSnIU/m+cPX3t3dpi0YKUuYR714=; b=mJUsRiiyQySmmewj5R1KB1bXjIJZv8m3os3+4WX5lH6+iNQ9p41jV7QQmS+q45c/4y finBaFEsRMx17OWmVL2ql6Coj8EYo2+jp5ULHuZESWvkvCV6a0LUzOBIN6/PNeuAtjAF 2JN1gUthxvEHicctrl8Yf6UvtIh8CWlljm0fK1PfXhN3coJm9mG3LS8lAi9giXEwXs1K AfhrQun4bmZ1UrhsEQsqgHTo5NMLdEbzs8JiHkSUEf9IcbG0kU864Sx+3BaoOQe9tiCs 8LhFAwOXjL1U53ylc2h+MqCZ2aao/xvRwP9LeYZI06i5whFusnPGmN0GR6pbHZ2D+LdQ tGfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ijvH7o0D; 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 x189-20020a6386c6000000b0039d9d694d34si7364425pgd.842.2022.04.14.10.01.22; Thu, 14 Apr 2022 10:01:47 -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=ijvH7o0D; 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 S242531AbiDNK4L (ORCPT + 99 others); Thu, 14 Apr 2022 06:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239644AbiDNKz6 (ORCPT ); Thu, 14 Apr 2022 06:55:58 -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 ESMTP id 0CC4276E07 for ; Thu, 14 Apr 2022 03:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649933613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qezaIFsTkLoWKaonJSnIU/m+cPX3t3dpi0YKUuYR714=; b=ijvH7o0Duuqlxr6Rfzh9gSsY2cDsvM75SJNtE5tc7Cxt5RNsIb9/5lhFovEpAgLzGAz6xE ozK+ZZFRmXKeKyJdh5SUY2dFaubwsAcu4aoQl0LCZQ2K33qx0dlo2YpCc4AAn5WuFw2hQc pmklIJlt9TvMRaG2YmRYhR6QHcgkCh0= 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-93-nt_ZLx7LN_edxJW2oG7ggg-1; Thu, 14 Apr 2022 06:53:30 -0400 X-MC-Unique: nt_ZLx7LN_edxJW2oG7ggg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3134801E95; Thu, 14 Apr 2022 10:53:29 +0000 (UTC) Received: from thuth.com (dhcp-192-232.str.redhat.com [10.33.192.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 708ABC28114; Thu, 14 Apr 2022 10:53:28 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, David Hildenbrand , Paolo Bonzini , Shuah Khan , Janis Schoetterl-Glausch Subject: [PATCH 3/4] KVM: s390: selftests: Use TAP interface in the tprot test Date: Thu, 14 Apr 2022 12:53:21 +0200 Message-Id: <20220414105322.577439-4-thuth@redhat.com> In-Reply-To: <20220414105322.577439-1-thuth@redhat.com> References: <20220414105322.577439-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 The tprot test currently does not have any output (unless one of the TEST_ASSERT statement fails), so it's hard to say for a user whether a certain new sub-test has been included in the binary or not. Let's make this a little bit more user-friendly and include some TAP output via the kselftests.h interface. Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/s390x/tprot.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/tprot.c b/tools/testing/selftests/kvm/s390x/tprot.c index c097b9db495e..a714b4206e95 100644 --- a/tools/testing/selftests/kvm/s390x/tprot.c +++ b/tools/testing/selftests/kvm/s390x/tprot.c @@ -8,6 +8,7 @@ #include #include "test_util.h" #include "kvm_util.h" +#include "kselftest.h" #define PAGE_SHIFT 12 #define PAGE_SIZE (1 << PAGE_SHIFT) @@ -69,6 +70,7 @@ enum stage { STAGE_INIT_FETCH_PROT_OVERRIDE, TEST_FETCH_PROT_OVERRIDE, TEST_STORAGE_PROT_OVERRIDE, + NUM_STAGES /* this must be the last entry */ }; struct test { @@ -196,6 +198,7 @@ static void guest_code(void) } \ ASSERT_EQ(uc.cmd, UCALL_SYNC); \ ASSERT_EQ(uc.args[1], __stage); \ + ksft_test_result_pass("" #stage "\n"); \ }) int main(int argc, char *argv[]) @@ -204,6 +207,9 @@ int main(int argc, char *argv[]) struct kvm_run *run; vm_vaddr_t guest_0_page; + ksft_print_header(); + ksft_set_plan(NUM_STAGES - 1); /* STAGE_END is not counted, thus - 1 */ + vm = vm_create_default(VCPU_ID, 0, guest_code); run = vcpu_state(vm, VCPU_ID); @@ -213,7 +219,7 @@ int main(int argc, char *argv[]) guest_0_page = vm_vaddr_alloc(vm, PAGE_SIZE, 0); if (guest_0_page != 0) - print_skip("Did not allocate page at 0 for fetch protection override tests"); + ksft_print_msg("Did not allocate page at 0 for fetch protection override tests\n"); HOST_SYNC(vm, STAGE_INIT_FETCH_PROT_OVERRIDE); if (guest_0_page == 0) mprotect(addr_gva2hva(vm, (vm_vaddr_t)0), PAGE_SIZE, PROT_READ); @@ -224,4 +230,8 @@ int main(int argc, char *argv[]) run->s.regs.crs[0] |= CR0_STORAGE_PROTECTION_OVERRIDE; run->kvm_dirty_regs = KVM_SYNC_CRS; HOST_SYNC(vm, TEST_STORAGE_PROT_OVERRIDE); + + kvm_vm_free(vm); + + ksft_finished(); } -- 2.27.0