[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6bd821a3-9dbe-499c-ae17-afce70076299@arm.com>
Date: Wed, 12 Jun 2024 16:43:41 +0530
From: Dev Jain <dev.jain@....com>
To: Muhammad Usama Anjum <usama.anjum@...labora.com>,
Marc Zyngier <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
James Morse <james.morse@....com>, Suzuki K Poulose
<suzuki.poulose@....com>, Zenghui Yu <yuzenghui@...wei.com>,
Paolo Bonzini <pbonzini@...hat.com>, Shuah Khan <shuah@...nel.org>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>, Sean Christopherson
<seanjc@...gle.com>, Haibo Xu <haibo1.xu@...el.com>,
Anup Patel <anup@...infault.org>, Andrew Jones <ajones@...tanamicro.com>,
Aaron Lewis <aaronlewis@...gle.com>, Thomas Huth <thuth@...hat.com>,
Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: kernel@...labora.com, Shuah Khan <skhan@...uxfoundation.org>,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
kvm@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, Dev Jain <dev.jain@....com>
Subject: Re: [PATCH 1/2] selftests: kvm: remove print_skip()
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);
Powered by blists - more mailing lists