From: Sean Christopherson Date: Mon, 18 Apr 2022 20:00:58 +0000 (-0700) Subject: KVM: selftests: Use vm_create_without_vcpus() in set_boot_cpu_id X-Git-Tag: v6.1-rc5~719^2~6^2~341 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb47ed8b71d06d7ede40374fd3064e2457eafb62;p=platform%2Fkernel%2Flinux-starfive.git KVM: selftests: Use vm_create_without_vcpus() in set_boot_cpu_id Use vm_create_without_vcpus() in set_boot_cpu_id instead of open coding the equivlant now that the "without_vcpus" variant does vm_adjust_num_guest_pages(). Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini --- diff --git a/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c b/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c index b4da92d..4c5775a 100644 --- a/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +++ b/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c @@ -82,18 +82,11 @@ static void run_vcpu(struct kvm_vm *vm, uint32_t vcpuid) static struct kvm_vm *create_vm(void) { - struct kvm_vm *vm; uint64_t vcpu_pages = (DEFAULT_STACK_PGS) * 2; uint64_t extra_pg_pages = vcpu_pages / PTES_PER_MIN_PAGE * N_VCPU; uint64_t pages = DEFAULT_GUEST_PHY_PAGES + vcpu_pages + extra_pg_pages; - pages = vm_adjust_num_guest_pages(VM_MODE_DEFAULT, pages); - vm = vm_create(pages); - - kvm_vm_elf_load(vm, program_invocation_name); - vm_create_irqchip(vm); - - return vm; + return vm_create_without_vcpus(VM_MODE_DEFAULT, pages); } static void add_x86_vcpu(struct kvm_vm *vm, uint32_t vcpuid, bool bsp_code)