aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64')
-rw-r--r--tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c4
-rw-r--r--tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
index d2c571f20521..2faa43336131 100644
--- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
+++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
@@ -369,10 +369,8 @@ static void test_pmu_config_disable(void (*guest_code)(void))
vm_enable_cap(vm, KVM_CAP_PMU_CAPABILITY, KVM_PMU_CAP_DISABLE);
- vm_vcpu_add_default(vm, 0, guest_code);
+ vcpu = vm_vcpu_add_default(vm, 0, guest_code);
vm_init_descriptor_tables(vm);
-
- vcpu = vcpu_get(vm, 0);
vcpu_init_descriptor_tables(vm, vcpu->id);
TEST_ASSERT(!sanity_check_pmu(vcpu),
diff --git a/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c b/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c
index b7cd5c47fc53..ea70ca2e63c3 100644
--- a/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c
+++ b/tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c
@@ -54,8 +54,7 @@ static void *run_vcpu(void *_cpu_nr)
/* The kernel is fine, but vm_vcpu_add_default() needs locking */
pthread_spin_lock(&create_lock);
- vm_vcpu_add_default(vm, vcpu_id, guest_code);
- vcpu = vcpu_get(vm, vcpu_id);
+ vcpu = vm_vcpu_add_default(vm, vcpu_id, guest_code);
if (!first_cpu_done) {
first_cpu_done = true;