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: <CADrL8HUAY62FX_TYqU9ro4wfhJhcCAC-aDW=zUS5eYQTbWx3oA@mail.gmail.com>
Date:   Thu, 27 Apr 2023 13:34:16 -0700
From:   James Houghton <jthoughton@...gle.com>
To:     Peter Xu <peterx@...hat.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        Sean Christopherson <seanjc@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Anish Moorthy <amoorthy@...gle.com>
Subject: Re: [PATCH 2/2] selftests/kvm: Allow dump per-vcpu info for uffd threads

On Thu, Apr 27, 2023 at 1:11 PM Peter Xu <peterx@...hat.com> wrote:
>
> There's one PER_VCPU_DEBUG in per-vcpu uffd threads but it's never hit.
>
> Trigger that when quit in normal ways (kick pollfd[1]), meanwhile fix the
> number of nanosec calculation.
>
> Signed-off-by: Peter Xu <peterx@...hat.com>

Reviewed-by: James Houghton <jthoughton@...gle.com>

> ---
>  tools/testing/selftests/kvm/lib/userfaultfd_util.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/userfaultfd_util.c b/tools/testing/selftests/kvm/lib/userfaultfd_util.c
> index 92cef20902f1..271f63891581 100644
> --- a/tools/testing/selftests/kvm/lib/userfaultfd_util.c
> +++ b/tools/testing/selftests/kvm/lib/userfaultfd_util.c
> @@ -70,7 +70,7 @@ static void *uffd_handler_thread_fn(void *arg)
>                         r = read(pollfd[1].fd, &tmp_chr, 1);
>                         TEST_ASSERT(r == 1,
>                                     "Error reading pipefd in UFFD thread\n");
> -                       return NULL;
> +                       break;
>                 }
>
>                 if (!(pollfd[0].revents & POLLIN))
> @@ -103,7 +103,7 @@ static void *uffd_handler_thread_fn(void *arg)
>         ts_diff = timespec_elapsed(start);
>         PER_VCPU_DEBUG("userfaulted %ld pages over %ld.%.9lds. (%f/sec)\n",
>                        pages, ts_diff.tv_sec, ts_diff.tv_nsec,
> -                      pages / ((double)ts_diff.tv_sec + (double)ts_diff.tv_nsec / 100000000.0));
> +                      pages / ((double)ts_diff.tv_sec + (double)ts_diff.tv_nsec / NSEC_PER_SEC));

I almost confused this fix for [1]. Thanks for catching this!

[1]: https://lore.kernel.org/kvm/20230223001805.2971237-1-amoorthy@google.com/

>
>         return NULL;
>  }
> --
> 2.39.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ