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]
Date:   Wed, 10 Feb 2021 17:56:04 -0800
From:   Sean Christopherson <seanjc@...gle.com>
To:     Ben Gardon <bgardon@...gle.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>, kvm <kvm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Yanan Wang <wangyanan55@...wei.com>,
        Andrew Jones <drjones@...hat.com>,
        Peter Xu <peterx@...hat.com>,
        Aaron Lewis <aaronlewis@...gle.com>
Subject: Re: [PATCH 09/15] KVM: selftests: Move per-VM GPA into perf_test_args

On Wed, Feb 10, 2021, Ben Gardon wrote:
> > diff --git a/tools/testing/selftests/kvm/lib/perf_test_util.c b/tools/testing/selftests/kvm/lib/perf_test_util.c
> > index f22ce1836547..03f125236021 100644
> > --- a/tools/testing/selftests/kvm/lib/perf_test_util.c
> > +++ b/tools/testing/selftests/kvm/lib/perf_test_util.c
> > @@ -9,8 +9,6 @@
> >
> >  struct perf_test_args perf_test_args;
> >
> > -uint64_t guest_test_phys_mem;
> > -
> >  /*
> >   * Guest virtual memory offset of the testing memory slot.
> >   * Must not conflict with identity mapped test code.
> > @@ -87,29 +85,25 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus,
> >         TEST_ASSERT(guest_num_pages < vm_get_max_gfn(vm),
> >                     "Requested more guest memory than address space allows.\n"
> >                     "    guest pages: %lx max gfn: %x vcpus: %d wss: %lx]\n",
> > -                   guest_num_pages, vm_get_max_gfn(vm), vcpus,
> > -                   vcpu_memory_bytes);
> > +                   guest_num_pages, vm_get_max_gfn(vm), vcpus, vcpu_memory_bytes);
> >
> > -       guest_test_phys_mem = (vm_get_max_gfn(vm) - guest_num_pages) *
> > -                             pta->guest_page_size;
> > -       guest_test_phys_mem &= ~(pta->host_page_size - 1);
> > +       pta->gpa = (vm_get_max_gfn(vm) - guest_num_pages) * pta->guest_page_size;
> > +       pta->gpa &= ~(pta->host_page_size - 1);
> 
> Also not related to this patch, but another case for align.
> 
> >         if (backing_src == VM_MEM_SRC_ANONYMOUS_THP ||
> >             backing_src == VM_MEM_SRC_ANONYMOUS_HUGETLB)
> > -               guest_test_phys_mem &= ~(KVM_UTIL_HUGEPAGE_ALIGNMENT - 1);
> > -
> > +               pta->gpa &= ~(KVM_UTIL_HUGEPAGE_ALIGNMENT - 1);
> 
> also align
> 
> >  #ifdef __s390x__
> >         /* Align to 1M (segment size) */
> > -       guest_test_phys_mem &= ~((1 << 20) - 1);
> > +       pta->gpa &= ~((1 << 20) - 1);
> 
> And here again (oof)

Yep, I'll fix all these and the align() comment in v2.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ