Lines Matching refs:vcpu
14 struct kvm_vcpu *vcpu; member
61 struct kvm_vcpu *vcpu = x->vcpu; in ____test_icr() local
71 vcpu_ioctl(vcpu, KVM_GET_LAPIC, &xapic); in ____test_icr()
74 vcpu_ioctl(vcpu, KVM_SET_LAPIC, &xapic); in ____test_icr()
76 vcpu_run(vcpu); in ____test_icr()
77 TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC); in ____test_icr()
80 vcpu_ioctl(vcpu, KVM_GET_LAPIC, &xapic); in ____test_icr()
111 struct kvm_vcpu *vcpu = x->vcpu; in test_icr() local
128 if (i == vcpu->id) in test_icr()
145 static void __test_apic_id(struct kvm_vcpu *vcpu, uint64_t apic_base) in __test_apic_id() argument
150 vcpu_set_msr(vcpu, MSR_IA32_APICBASE, apic_base); in __test_apic_id()
152 vcpu_ioctl(vcpu, KVM_GET_LAPIC, &xapic); in __test_apic_id()
154 expected = apic_base & X2APIC_ENABLE ? vcpu->id : vcpu->id << 24; in __test_apic_id()
201 struct kvm_vcpu *vcpu; in test_x2apic_id() local
205 vm = vm_create_with_one_vcpu(&vcpu, NULL); in test_x2apic_id()
206 vcpu_set_msr(vcpu, MSR_IA32_APICBASE, MSR_IA32_APICBASE_ENABLE | X2APIC_ENABLE); in test_x2apic_id()
215 vcpu_ioctl(vcpu, KVM_SET_LAPIC, &lapic); in test_x2apic_id()
217 vcpu_ioctl(vcpu, KVM_GET_LAPIC, &lapic); in test_x2apic_id()
218 TEST_ASSERT(*((u32 *)&lapic.regs[APIC_ID]) == vcpu->id << 24, in test_x2apic_id()
228 .vcpu = NULL, in main()
233 vm = vm_create_with_one_vcpu(&x.vcpu, x2apic_guest_code); in main()
242 vm = vm_create_with_one_vcpu(&x.vcpu, xapic_guest_code); in main()
254 vcpu_clear_cpuid_feature(x.vcpu, X86_FEATURE_X2APIC); in main()