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:   Fri, 10 Jun 2022 14:33:11 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Andrew Jones <drjones@...hat.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        David Matlack <dmatlack@...gle.com>,
        Ben Gardon <bgardon@...gle.com>,
        Oliver Upton <oupton@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 126/144] KVM: selftests: Convert kvm_binary_stats_test
 away from vCPU IDs

On Fri, Jun 10, 2022, Andrew Jones wrote:
> On Fri, Jun 03, 2022 at 12:43:13AM +0000, Sean Christopherson wrote:
> > @@ -220,17 +221,21 @@ int main(int argc, char *argv[])
> >  	/* Create VMs and VCPUs */
> >  	vms = malloc(sizeof(vms[0]) * max_vm);
> >  	TEST_ASSERT(vms, "Allocate memory for storing VM pointers");
> > +
> > +	vcpus = malloc(sizeof(struct kvm_vcpu *) * max_vm * max_vcpu);
> > +	TEST_ASSERT(vcpus, "Allocate memory for storing vCPU pointers");
> > +
> >  	for (i = 0; i < max_vm; ++i) {
> >  		vms[i] = vm_create_barebones();
> >  		for (j = 0; j < max_vcpu; ++j)
> > -			__vm_vcpu_add(vms[i], j);
> > +			vcpus[j * max_vcpu + i] = __vm_vcpu_add(vms[i], j);
> 
> The expression for the index should be 'i * max_vcpu + j'. The swapped
> i,j usage isn't causing problems now because
> DEFAULT_NUM_VM == DEFAULT_NUM_VCPU, but that could change.

It's better to be lucky than good?

Thanks much, I appreciate the reviews!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ