Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp367368lqp; Wed, 12 Jun 2024 04:14:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLfQUH27fOlS25UqAoxhvmpq50Zmam8RCGz0oVPG8wLGLVWuHPpcAembK9FpTXBH4cjCKxqWqxiRD1vfx8LC+6QGjtlUIv9pTpSMPcYw== X-Google-Smtp-Source: AGHT+IE7Z1RVlsltHkuonKz4V+Urkvy53JQbHsB5NUHUAfTv3hXpQSMmBZ/O+uxX4vJ27Zx36CUw X-Received: by 2002:a17:90a:4802:b0:2c2:e2a5:30cc with SMTP id 98e67ed59e1d1-2c4a774413dmr1365165a91.49.1718190854581; Wed, 12 Jun 2024 04:14:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718190854; cv=pass; d=google.com; s=arc-20160816; b=iQcI4xE2bxUexzZyz11F8KRcfq0JOyQ7a5b2lcah6hjSA2SHGPUxc4pLltoOgK3ldI itIsoRKfov4ULqqC9VzYJyNKKnMdEAZBVcvPy7FzztVzHo5NQytNaiLjZagYKAABiqkx CrvjCIB3k9BGti4XTbnU+xmZSwMj0YYaFcrbE2K0/Mr11N+ECMQHoagXohMjGIbJl5Mz osIaTe72Sk6MTN/nAIeR7ScMH2B9F4ckKrZtA4H/NuXTeCERIZcdmf1uTAZrkRw5YEek OHiefFML+rHfd30ZaqINsZnwnf9U3ySU+6bfrrHZ9wtEjyrQ/t1kbS7vH+ULfq5wXc53 pb8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=wkrDEk4rHuMr1iEPi3EehDsIqPS26rFiWxrQ4ZDWkQ0=; fh=/OgB6nNiE1i04fnzT2VYxYGFxzyQuWtfBwK6GNP0X0k=; b=0jGEQ1LVvlisXRIYTbclSyzY2VloY4FjKtrnpPtAWvLSNGB1URN3oSrKQgRcY6uO7l 54fb3/ZvGBcmmBhZbAXup3p5H1kJe41KfrRLIEUqQC2/2gIfGy51ALVg4dizw1yNc1WS 0ITxpZmxYUuNAMe4AhKFhyeV4zsp3kacTOTGNjAz9Aec0f4NZs/VPoZIYO9B9au4M/Xd UJlEW7eoe3MOdOJLY68+lsMhBNIg8aaFn1Tp8Rl4nyxBdea4X7Q6oDLIQenM10Vcb+Pf q4V8dbBMmlkW5VkDKvyIQ2SUWBlt/wfIsTXFtD8YL/ynfHGgOFH8H1ftiR8EFuYvAknz YC+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-211401-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211401-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a76abb35si1289160a91.92.2024.06.12.04.14.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 04:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211401-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-211401-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211401-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C4513286B53 for ; Wed, 12 Jun 2024 11:14:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E741416F277; Wed, 12 Jun 2024 11:13:57 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E680716F0D1; Wed, 12 Jun 2024 11:13:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718190837; cv=none; b=QJvZ0SNYFvcETct08XKnbnjRgYTRVMm2vaPMwb3gpf1UGMitsKpUQ8c+/bR5/yLclilURNqdLtl2ACbfuQn8YSwoybs0pmsLyL2a6b4+fbVuNycUu1jC3AvrXrFj39qvKkSOfohdvg5HS8ciM3x+qQWmUQe9G2/pKcnaM2cvjkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718190837; c=relaxed/simple; bh=tGPupE+j4PNoFUUhCfT2XJ/QhRvNfK0mEe6nInmY/cE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TnpMBYhcXl89SILb98yESXpxa7CoU68IpcjtkQ6rXkd4PM0duWRkqr5xXm1cb7pIw/KZN1pbJ0rHMbfKtwPuIIn2R4/SpV7S1c5Vafjj56q5ts3V6GPu5yED5DrhgMug7qRUWWYDuAlSRRs+db71QOO2W2IwTPlR0XjbTfIWt/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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);