Lines Matching full:run
92 struct kvm_run *run = (struct kvm_run *)arg; in race_events_inj_pen() local
93 struct kvm_vcpu_events *events = &run->s.regs.events; in race_events_inj_pen()
98 WRITE_ONCE(run->kvm_dirty_regs, KVM_SYNC_X86_EVENTS); in race_events_inj_pen()
115 struct kvm_run *run = (struct kvm_run *)arg; in race_events_exc() local
116 struct kvm_vcpu_events *events = &run->s.regs.events; in race_events_exc()
119 WRITE_ONCE(run->kvm_dirty_regs, KVM_SYNC_X86_EVENTS); in race_events_exc()
137 struct kvm_run *run = (struct kvm_run *)arg; in race_sregs_cr4() local
138 __u64 *cr4 = &run->s.regs.sregs.cr4; in race_sregs_cr4()
143 WRITE_ONCE(run->kvm_dirty_regs, KVM_SYNC_X86_SREGS); in race_sregs_cr4()
161 struct kvm_run *run; in race_sync_regs() local
165 run = vcpu->run; in race_sync_regs()
167 run->kvm_valid_regs = KVM_SYNC_X86_SREGS; in race_sync_regs()
169 run->kvm_valid_regs = 0; in race_sync_regs()
175 * Selftests run 64-bit guests by default, both EFER.LME and CR4.PAE in race_sync_regs()
178 TEST_ASSERT((run->s.regs.sregs.cr4 & X86_CR4_PAE) && in race_sync_regs()
179 (run->s.regs.sregs.efer & EFER_LME), in race_sync_regs()
181 !!(run->s.regs.sregs.cr4 & X86_CR4_PAE), in race_sync_regs()
182 !!(run->s.regs.sregs.efer & EFER_LME)); in race_sync_regs()
184 TEST_ASSERT_EQ(pthread_create(&thread, NULL, racer, (void *)run), 0); in race_sync_regs()
193 if (!__vcpu_run(vcpu) && run->exit_reason == KVM_EXIT_SHUTDOWN) in race_sync_regs()
210 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
214 run->kvm_valid_regs = INVALID_SYNC_FIELD; in KVM_ONE_VCPU_TEST()
219 run->kvm_valid_regs = 0; in KVM_ONE_VCPU_TEST()
221 run->kvm_valid_regs = INVALID_SYNC_FIELD | TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
226 run->kvm_valid_regs = 0; in KVM_ONE_VCPU_TEST()
231 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
235 run->kvm_dirty_regs = INVALID_SYNC_FIELD; in KVM_ONE_VCPU_TEST()
240 run->kvm_dirty_regs = 0; in KVM_ONE_VCPU_TEST()
242 run->kvm_dirty_regs = INVALID_SYNC_FIELD | TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
247 run->kvm_dirty_regs = 0; in KVM_ONE_VCPU_TEST()
252 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
259 run->kvm_valid_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
264 compare_regs(®s, &run->s.regs.regs); in KVM_ONE_VCPU_TEST()
267 compare_sregs(&sregs, &run->s.regs.sregs); in KVM_ONE_VCPU_TEST()
270 compare_vcpu_events(&events, &run->s.regs.events); in KVM_ONE_VCPU_TEST()
275 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
280 /* Run once to get register set */ in KVM_ONE_VCPU_TEST()
281 run->kvm_valid_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
286 run->s.regs.regs.rbx = 0xBAD1DEA; in KVM_ONE_VCPU_TEST()
287 run->s.regs.sregs.apic_base = 1 << 11; in KVM_ONE_VCPU_TEST()
288 /* TODO run->s.regs.events.XYZ = ABC; */ in KVM_ONE_VCPU_TEST()
290 run->kvm_valid_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
291 run->kvm_dirty_regs = KVM_SYNC_X86_REGS | KVM_SYNC_X86_SREGS; in KVM_ONE_VCPU_TEST()
294 TEST_ASSERT(run->s.regs.regs.rbx == 0xBAD1DEA + 1, in KVM_ONE_VCPU_TEST()
296 run->s.regs.regs.rbx); in KVM_ONE_VCPU_TEST()
297 TEST_ASSERT(run->s.regs.sregs.apic_base == 1 << 11, in KVM_ONE_VCPU_TEST()
299 run->s.regs.sregs.apic_base); in KVM_ONE_VCPU_TEST()
302 compare_regs(®s, &run->s.regs.regs); in KVM_ONE_VCPU_TEST()
305 compare_sregs(&sregs, &run->s.regs.sregs); in KVM_ONE_VCPU_TEST()
308 compare_vcpu_events(&events, &run->s.regs.events); in KVM_ONE_VCPU_TEST()
313 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
318 run->kvm_valid_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
319 run->kvm_dirty_regs = 0; in KVM_ONE_VCPU_TEST()
320 run->s.regs.regs.rbx = 0xDEADBEEF; in KVM_ONE_VCPU_TEST()
323 TEST_ASSERT(run->s.regs.regs.rbx != 0xDEADBEEF, in KVM_ONE_VCPU_TEST()
325 run->s.regs.regs.rbx); in KVM_ONE_VCPU_TEST()
330 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
333 /* Run once to get register set */ in KVM_ONE_VCPU_TEST()
334 run->kvm_valid_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
342 run->kvm_valid_regs = 0; in KVM_ONE_VCPU_TEST()
343 run->kvm_dirty_regs = 0; in KVM_ONE_VCPU_TEST()
344 run->s.regs.regs.rbx = 0xAAAA; in KVM_ONE_VCPU_TEST()
350 TEST_ASSERT(run->s.regs.regs.rbx == 0xAAAA, in KVM_ONE_VCPU_TEST()
352 run->s.regs.regs.rbx); in KVM_ONE_VCPU_TEST()
361 struct kvm_run *run = vcpu->run; in KVM_ONE_VCPU_TEST() local
364 /* Run once to get register set */ in KVM_ONE_VCPU_TEST()
365 run->kvm_valid_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
373 run->kvm_valid_regs = 0; in KVM_ONE_VCPU_TEST()
374 run->kvm_dirty_regs = TEST_SYNC_FIELDS; in KVM_ONE_VCPU_TEST()
375 run->s.regs.regs.rbx = 0xBBBB; in KVM_ONE_VCPU_TEST()
378 TEST_ASSERT(run->s.regs.regs.rbx == 0xBBBB, in KVM_ONE_VCPU_TEST()
380 run->s.regs.regs.rbx); in KVM_ONE_VCPU_TEST()