]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: selftests: Drop @vcpuids param from VM creators
authorSean Christopherson <seanjc@google.com>
Wed, 16 Feb 2022 20:49:13 +0000 (12:49 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 15:47:16 +0000 (11:47 -0400)
Drop the @vcpuids parameter from VM creators now that there are no users.
Allowing tests to specify IDs was a gigantic mistake as it resulted in
tests with arbitrary and ultimately meaningless IDs that differed only
because the author used test X intead of test Y as the source for
copy+paste (the de facto standard way to create a KVM selftest).

Except for literally two tests, x86's set_boot_cpu_id and s390's resets,
tests do not and should not care about the vCPU ID.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/kvm_page_table_test.c
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/perf_test_util.c

index 90521c5716b1b8cfeaa2152d2650a70786200bc7..f409bae336d58ab464be0f593af88cea2adc2e88 100644 (file)
@@ -563,7 +563,7 @@ static inline struct kvm_vm *vm_create(uint64_t nr_pages)
 struct kvm_vm *__vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
                                      uint64_t slot0_mem_pages, uint64_t extra_mem_pages,
                                      uint32_t num_percpu_pages, void *guest_code,
-                                     uint32_t vcpuids[], struct kvm_vcpu *vcpus[]);
+                                     struct kvm_vcpu *vcpus[]);
 
 static inline struct kvm_vm *vm_create_with_vcpus(uint32_t nr_vcpus,
                                                  void *guest_code,
@@ -571,7 +571,7 @@ static inline struct kvm_vm *vm_create_with_vcpus(uint32_t nr_vcpus,
 {
        return __vm_create_with_vcpus(VM_MODE_DEFAULT, nr_vcpus,
                                      DEFAULT_GUEST_PHY_PAGES, 0, 0,
-                                     guest_code, NULL, vcpus);
+                                     guest_code, vcpus);
 }
 
 /*
index e91bc7f1400d111e9d610e1283942319c4d0d3b6..76031be195fab5b3d42533971a04566482ee14b4 100644 (file)
@@ -269,7 +269,7 @@ static struct kvm_vm *pre_init_before_test(enum vm_guest_mode mode, void *arg)
        /* Create a VM with enough guest pages */
        guest_num_pages = test_mem_size / guest_page_size;
        vm = __vm_create_with_vcpus(mode, nr_vcpus, DEFAULT_GUEST_PHY_PAGES,
-                                   guest_num_pages, 0, guest_code, NULL, NULL);
+                                   guest_num_pages, 0, guest_code, NULL);
 
        /* Align down GPA of the testing memslot */
        if (!p->phys_offset)
index 137ffa1bc1f285faaf8b66407ca819a4c1cac5a4..c338713d8245395eb01e38731df1da8853392dd7 100644 (file)
@@ -299,7 +299,7 @@ struct kvm_vm *__vm_create(enum vm_guest_mode mode, uint64_t nr_pages)
 struct kvm_vm *__vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
                                      uint64_t slot0_mem_pages, uint64_t extra_mem_pages,
                                      uint32_t num_percpu_pages, void *guest_code,
-                                     uint32_t vcpuids[], struct kvm_vcpu *vcpus[])
+                                     struct kvm_vcpu *vcpus[])
 {
        uint64_t vcpu_pages, extra_pg_pages, pages;
        struct kvm_vcpu *vcpu;
@@ -327,9 +327,7 @@ struct kvm_vm *__vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus
        vm = __vm_create(mode, pages);
 
        for (i = 0; i < nr_vcpus; ++i) {
-               uint32_t vcpuid = vcpuids ? vcpuids[i] : i;
-
-               vcpu = vm_vcpu_add(vm, vcpuid, guest_code);
+               vcpu = vm_vcpu_add(vm, i, guest_code);
                if (vcpus)
                        vcpus[i] = vcpu;
        }
@@ -345,7 +343,7 @@ struct kvm_vm *__vm_create_with_one_vcpu(struct kvm_vcpu **vcpu,
        struct kvm_vm *vm;
 
        vm = __vm_create_with_vcpus(VM_MODE_DEFAULT, 1, DEFAULT_GUEST_PHY_PAGES,
-                                   extra_mem_pages, 0, guest_code, NULL, vcpus);
+                                   extra_mem_pages, 0, guest_code, vcpus);
 
        *vcpu = vcpus[0];
        return vm;
index d3ff05f00653d43f074ac12a4bd0b8e4c103d320..05f65c9292eb6566f0e01c0d1b4971786987ec6a 100644 (file)
@@ -149,7 +149,7 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus,
         */
        vm = __vm_create_with_vcpus(mode, vcpus, DEFAULT_GUEST_PHY_PAGES,
                                    slot0_pages + guest_num_pages, 0,
-                                   perf_test_guest_code, NULL, NULL);
+                                   perf_test_guest_code, NULL);
 
        pta->vm = vm;