summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-09 10:19:01 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-11 11:46:33 -0400
commiteb0adbc03aafdb3dd0740eaaeb26051fd5e35c20 (patch)
tree2b7bb56819fd11bacd10d7bd2c4853e480dfc6d1 /tools/testing
parent47b1e0ec2e1460b25674ba947723052919da7e67 (diff)
downloadlinux-eb0adbc03aafdb3dd0740eaaeb26051fd5e35c20.tar.bz2
KVM: selftests: Avoid memory allocations when adding vCPU in get-reg-list
Open code adding and doing setup for a vCPU in get-reg-list in order to avoid the stack allocation that comes with aarch64_vcpu_add_default(). get-reg-list doesn't need to run the vCPU, and so doesn't need the guest to be backed with memory. This will allow future cleanup to turn what is current vm_create() into a barebones helper. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/kvm/aarch64/get-reg-list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index ecfb773ec41e..b2d1d2eaf1d3 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -418,7 +418,8 @@ static void run_test(struct vcpu_config *c)
vm = vm_create(DEFAULT_GUEST_PHY_PAGES);
prepare_vcpu_init(c, &init);
- aarch64_vcpu_add_default(vm, 0, &init, NULL);
+ vm_vcpu_add(vm, 0);
+ aarch64_vcpu_setup(vm, 0, &init);
finalize_vcpu(vm, 0, c);
reg_list = vcpu_get_reg_list(vm, 0);