Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp837303pxb; Fri, 22 Apr 2022 12:14:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSsv4g2r9qEbCbRNMnFdCqMw2jcGNzji7Oq/Bb75aQtZB1slif/LUrX69mEf4gBBBW2vbg X-Received: by 2002:a17:903:41cb:b0:158:fe29:2c41 with SMTP id u11-20020a17090341cb00b00158fe292c41mr5894116ple.0.1650654871960; Fri, 22 Apr 2022 12:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650654871; cv=none; d=google.com; s=arc-20160816; b=do7JjJbcxjjg4cnQeE/xCsfWcJcKQZek4kyAaZkohjOuI7R3ZWwA+2WsXheH4kg/5r 14ammiPRTOILN2/3cDC3kzVwYOHjaz93/gldSoMNnCfNP9VCEjJEcjAzeig9q/eShtGT 1Z652Me1/TxUe7UKbOKTfbLP2viRJxsY8eLic+iuXp/qCc5B2Bvf0eISj+wx1dc9hnLu 0mFeSeE715A3eydXBJymK/Hf6pytak4qrYKbrYrHK3c7Ncr2GFqMLYF5DTynD+P5MFmZ rwmrQoH8iiBKurbUU68wB71AIZzZAyu8He2ymJtHE9XHO0f/4qmxV7OO70x+Wha/Bd/V lwIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=CIbd+9/ujIgy/587mPK12BUlw+gv3FwEVww95EhOZhc=; b=jfTzT3YNroSDXW5lT6/o6Ks62iAEP5cHf/djQJbWViCHeIl8FzXY0L6aIiEZnngq4q RdYdqWLQTLeUKmbiBZ4Wqa1tGsC/MCwppufyfRNiYL5UwBBNPhPcCCaLRDzmv3WsnFc7 zYf2tn7usv251NJpYRrBIvhJVH13am5iizzt1j+8liLpDnNP2m7Ha3cRcBv7/WN2QAEq pvUdrWXn8gR0+XUdWrk9u6ME0b/1FYTqLwkuTMxsGxZMYcYDFpcr+l/v5psNXQmyBE5f goo8mzywFU+n7e2Ekkh73PFDhT6Y+7xXsWUM3i3OibHsRjJEQ7iIHgK49wvvWhTZKHzJ eQgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FzfgusaT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e7-20020a6558c7000000b003aad1031756si1936849pgu.19.2022.04.22.12.14.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:14:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FzfgusaT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6BF4F1132CF; Fri, 22 Apr 2022 11:31:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356044AbiDSRsB (ORCPT + 99 others); Tue, 19 Apr 2022 13:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242179AbiDSRr6 (ORCPT ); Tue, 19 Apr 2022 13:47: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 C3D186446 for ; Tue, 19 Apr 2022 10:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650390310; 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=CIbd+9/ujIgy/587mPK12BUlw+gv3FwEVww95EhOZhc=; b=FzfgusaTP3uupX5j2CrjekK6BKwYqzSr/UnvpSS+2595wbr8rXgH1SrUhrIludgdJKJra5 t3T6jN0+CiuYHExv7EEq0ziyHI5U2brNYbVgvjR3WnBcHmLziuNxOC1KpUZ7z6G51XggUa /o9L9jinPWAZbBC49t24KgzGRWlE5Ho= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-uOAKslEBOYKmtkBKIjSexA-1; Tue, 19 Apr 2022 13:45:09 -0400 X-MC-Unique: uOAKslEBOYKmtkBKIjSexA-1 Received: by mail-wm1-f69.google.com with SMTP id l41-20020a05600c1d2900b0038ec007ac7fso1662572wms.4 for ; Tue, 19 Apr 2022 10:45:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=CIbd+9/ujIgy/587mPK12BUlw+gv3FwEVww95EhOZhc=; b=HQokeSOvUn89ukifdAT+y/ZAt9WusL+mP3trmn7SNkWzDls1YJ6xJA89zDPfudNYEn +94UVGvZGA4tAd9B4FKMetBePftA8amj43yAytVNNOoPi0zqLshKrn9gmOth3A/h1mcI 6IzyK521QWG7HobVxwxq20TpNNfLTyAx5hj5UzFycXjOYfbaNZN13KwW0u+ojqojM480 PncxJ/fIY4/IpxhGYiOWlrrxOwH+1WiFSGh8rbfNulFY1s+AedovMr+kiMxFTczxclsP w2WCbE6+Nmo22wHtlMrY1K+JJ6ncXLKN8rI36jR12njChUMtQeUetMidv+YYeC6JMLzX SC8Q== X-Gm-Message-State: AOAM533XLn4lIFKNU2aU2zvmw8LzwAYfZHuRmAS0Z35NCPGwbIsgJG5B kqxXIeDbV+L1s7zeuUrerCvROEn9BWr+Z/1tdlh45K5svogVQeqhqe/xykBvl4JK8KeWKaLrc7C FMNew9+/Lllr+ZQGTA1zL2QmB X-Received: by 2002:a1c:a185:0:b0:392:206d:209d with SMTP id k127-20020a1ca185000000b00392206d209dmr16849534wme.168.1650390308383; Tue, 19 Apr 2022 10:45:08 -0700 (PDT) X-Received: by 2002:a1c:a185:0:b0:392:206d:209d with SMTP id k127-20020a1ca185000000b00392206d209dmr16849514wme.168.1650390308129; Tue, 19 Apr 2022 10:45:08 -0700 (PDT) Received: from [192.168.8.102] (dynamic-046-114-170-162.46.114.pool.telefonica.de. [46.114.170.162]) by smtp.gmail.com with ESMTPSA id v188-20020a1cacc5000000b0038e9c60f0e7sm16397144wme.28.2022.04.19.10.45.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 10:45:07 -0700 (PDT) Message-ID: Date: Tue, 19 Apr 2022 19:45:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 3/4] KVM: s390: selftests: Use TAP interface in the tprot test Content-Language: en-US To: Janis Schoetterl-Glausch , Claudio Imbrenda Cc: kvm@vger.kernel.org, Christian Borntraeger , Janosch Frank , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, David Hildenbrand , Paolo Bonzini , Shuah Khan References: <20220414105322.577439-1-thuth@redhat.com> <20220414105322.577439-4-thuth@redhat.com> <20220414135110.6b2baead@p-imbrenda> <03f62ec7-2f7f-1f90-3029-d93713ab5afc@redhat.com> From: Thomas Huth In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE 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 On 14/04/2022 14.33, Janis Schoetterl-Glausch wrote: > On 4/14/22 14:08, Thomas Huth wrote: >> On 14/04/2022 13.51, Claudio Imbrenda wrote: >>> On Thu, 14 Apr 2022 12:53:21 +0200 >>> Thomas Huth wrote: >>> >>>> 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 */ > > You could move STAGE_END down and use that instead. > >>>>   }; >>>>     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"); >>> >>> will this print a skip, though? >> >> No, it's now only a message. >> >>> or you don't want to print a skip because then the numbering in the >>> planning doesn't match anymore? >> >> Right. >> >>> in which case, is there an easy way to fix it? >> >> Honestly, this part of the code is a little bit of a riddle to me - I wonder why this was using "print_skip()" at all, since the HOST_SYNC below is executed anyway... so this sounds rather like a warning message to me that says that the following test might not work as expected, instead of a real test-is-skipped message? >> >> Janis, could you please clarify the intention here? > > Both the host and the guest check the same condition independently, the host just to print the message, > then the guest is run and skips those stages. Ok. However, I'm not sure how to make this use ksft_test_result_skip() in a nice way now, though, without makeing the macro way uglier ... I'll have a try, but if that does not work out I'd suggest to simply keep the ksft_print_msg() here instead. Thomas