Commit eb0adbc0 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

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: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 47b1e0ec
...@@ -418,7 +418,8 @@ static void run_test(struct vcpu_config *c) ...@@ -418,7 +418,8 @@ static void run_test(struct vcpu_config *c)
vm = vm_create(DEFAULT_GUEST_PHY_PAGES); vm = vm_create(DEFAULT_GUEST_PHY_PAGES);
prepare_vcpu_init(c, &init); 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); finalize_vcpu(vm, 0, c);
reg_list = vcpu_get_reg_list(vm, 0); reg_list = vcpu_get_reg_list(vm, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment