lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANgfPd_WV+8bAHucE=81eFTEEPv5Q-2ZjQ_beKhZyQnt4PX57Q@mail.gmail.com>
Date:   Wed, 19 May 2021 14:49:53 -0700
From:   Ben Gardon <bgardon@...gle.com>
To:     Axel Rasmussen <axelrasmussen@...gle.com>
Cc:     Aaron Lewis <aaronlewis@...gle.com>,
        Alexander Graf <graf@...zon.com>,
        Andrew Jones <drjones@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Emanuele Giuseppe Esposito <eesposit@...hat.com>,
        Eric Auger <eric.auger@...hat.com>,
        Jacob Xu <jacobhxu@...gle.com>,
        Makarand Sonare <makarandsonare@...gle.com>,
        Oliver Upton <oupton@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Peter Xu <peterx@...hat.com>, Shuah Khan <shuah@...nel.org>,
        Yanan Wang <wangyanan55@...wei.com>, kvm <kvm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v2 03/10] KVM: selftests: print a message when skipping
 KVM tests

On Wed, May 19, 2021 at 1:03 PM Axel Rasmussen <axelrasmussen@...gle.com> wrote:
>
> Previously, if this check failed, we'd just exit quietly with no output.
> This can be confusing, so print out a short message indicating why the
> test is being skipped.
>
> Signed-off-by: Axel Rasmussen <axelrasmussen@...gle.com>

Reviewed-by: Ben Gardon <bgardon@...gle.com>

> ---
>  tools/testing/selftests/kvm/lib/kvm_util.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
> index f05ca919cccb..0d6ddee429b9 100644
> --- a/tools/testing/selftests/kvm/lib/kvm_util.c
> +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
> @@ -53,8 +53,10 @@ int kvm_check_cap(long cap)
>         int kvm_fd;
>
>         kvm_fd = open(KVM_DEV_PATH, O_RDONLY);
> -       if (kvm_fd < 0)
> +       if (kvm_fd < 0) {
> +               print_skip("KVM not available, errno: %d", errno);
>                 exit(KSFT_SKIP);
> +       }

This is a wonderful change. I believe this will only be hit if KVM is
built as a module and that module has not yet been loaded, so this
message could also suggest that the user check if the KVM / KVM
arch/vendor specific module has been loaded.

>
>         ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
>         TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
> --
> 2.31.1.751.gd2f1c929bd-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ