From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CC85C27C53 for ; Wed, 12 Jun 2024 11:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wkrDEk4rHuMr1iEPi3EehDsIqPS26rFiWxrQ4ZDWkQ0=; b=rwf0lDZ82mrVhhdh//QgXrMQGC ZqHBOwex+Xxu76wJQEvbs7xgdFIPZFNMGCVf7iYadvE0Pc6ZmuPDZwyNjPZxgn5WY4U5ThQN0pYWk g3wh7nq1ox1VsE/cNAbgvu17kSY+rKoEljpSn73FZRyRxjiCPfKFkX695NGipXbtmIfGBzMXYXfva nUZAPXxdrXgpVm9xga5WAUzd7H8ATWDczueVsmk5vuY9FQHsPIYcHafNZtAR4iful5uwCVnPFUrcZ ifLnGkf8ndRlFSF6KSILZ1jEnAJZ9uzUMpxlQfmmu2H7zgw/aGRjEfJ8l78D1GqRlJ6kCMXRLZV4D fOgNOVmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHLvW-0000000CP8U-1byT; Wed, 12 Jun 2024 11:14:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHLvS-0000000CP6Q-2ujs for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2024 11:14:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B5F421595; Wed, 12 Jun 2024 04:14:18 -0700 (PDT) Received: from [10.162.42.15] (e116581.arm.com [10.162.42.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 471543F73B; Wed, 12 Jun 2024 04:13:45 -0700 (PDT) Message-ID: <6bd821a3-9dbe-499c-ae17-afce70076299@arm.com> Date: Wed, 12 Jun 2024 16:43:41 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] selftests: kvm: remove print_skip() To: Muhammad Usama Anjum , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Shuah Khan , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , Sean Christopherson , Haibo Xu , Anup Patel , Andrew Jones , Aaron Lewis , Thomas Huth , Maciej Wieczor-Retman , Vitaly Kuznetsov Cc: kernel@collabora.com, Shuah Khan , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Dev Jain References: <20240612104500.425012-1-usama.anjum@collabora.com> Content-Language: en-US From: Dev Jain In-Reply-To: <20240612104500.425012-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240612_041358_893394_A684A19D X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/12/24 16:14, Muhammad Usama Anjum wrote: > > > diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c b/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c > index 4f5881d4ef66d..695c45635d257 100644 > --- a/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c > +++ b/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c > @@ -144,10 +144,9 @@ int main(int argc, char *argv[]) > free((void *)hv_cpuid_entries); > > if (!kvm_cpu_has(X86_FEATURE_VMX) || > - !kvm_has_cap(KVM_CAP_HYPERV_ENLIGHTENED_VMCS)) { > - print_skip("Enlightened VMCS is unsupported"); > - goto do_sys; > - } > + !kvm_has_cap(KVM_CAP_HYPERV_ENLIGHTENED_VMCS)) > + ksft_exit_skip("Enlightened VMCS is unsupported\n"); > + Isn't it incorrect to delete 'goto do_sys'? ksft_exit_skip() will exit and the program will never jump to that label. At other places too you have deleted the 'goto'. > vcpu_enable_evmcs(vcpu); > hv_cpuid_entries = vcpu_get_supported_hv_cpuid(vcpu); > test_hv_cpuid(hv_cpuid_entries, true); > @@ -155,10 +154,8 @@ int main(int argc, char *argv[]) > > do_sys: > /* Test system ioctl version */ > - if (!kvm_has_cap(KVM_CAP_SYS_HYPERV_CPUID)) { > - print_skip("KVM_CAP_SYS_HYPERV_CPUID not supported"); > - goto out; > - } > + if (!kvm_has_cap(KVM_CAP_SYS_HYPERV_CPUID)) > + ksft_exit_skip("KVM_CAP_SYS_HYPERV_CPUID not supported\n"); > > test_hv_cpuid_e2big(vm, NULL); > > diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_extended_hypercalls.c b/tools/testing/selftests/kvm/x86_64/hyperv_extended_hypercalls.c > index 949e08e98f315..d37212a27990b 100644 > --- a/tools/testing/selftests/kvm/x86_64/hyperv_extended_hypercalls.c > +++ b/tools/testing/selftests/kvm/x86_64/hyperv_extended_hypercalls.c > @@ -47,10 +47,8 @@ int main(void) > > /* Verify if extended hypercalls are supported */ > if (!kvm_cpuid_has(kvm_get_supported_hv_cpuid(), > - HV_ENABLE_EXTENDED_HYPERCALLS)) { > - print_skip("Extended calls not supported by the kernel"); > - exit(KSFT_SKIP); > - } > + HV_ENABLE_EXTENDED_HYPERCALLS)) > + ksft_exit_skip("Extended calls not supported by the kernel\n"); > > vm = vm_create_with_one_vcpu(&vcpu, guest_code); > run = vcpu->run; > diff --git a/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c b/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c > index 57f157c06b393..1dcb37a1f0be9 100644 > --- a/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c > +++ b/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c > @@ -273,10 +273,8 @@ int main(int argc, char *argv[]) > kvm_ioctl(vm->kvm_fd, KVM_X86_GET_MCE_CAP_SUPPORTED, > &supported_mcg_caps); > > - if (!(supported_mcg_caps & MCG_CMCI_P)) { > - print_skip("MCG_CMCI_P is not supported"); > - exit(KSFT_SKIP); > - } > + if (!(supported_mcg_caps & MCG_CMCI_P)) > + ksft_exit_skip("MCG_CMCI_P is not supported\n"); > > ucna_vcpu = create_vcpu_with_mce_cap(vm, 0, true, ucna_injection_guest_code); > cmcidis_vcpu = create_vcpu_with_mce_cap(vm, 1, false, cmci_disabled_guest_code);