Lines Matching refs:run
91 struct kvm_run *run = (struct kvm_run *)arg; in race_events_inj_pen() local
92 struct kvm_vcpu_events *events = &run->s.regs.events; in race_events_inj_pen()
97 WRITE_ONCE(run->kvm_dirty_regs, KVM_SYNC_X86_EVENTS); in race_events_inj_pen()
114 struct kvm_run *run = (struct kvm_run *)arg; in race_events_exc() local
115 struct kvm_vcpu_events *events = &run->s.regs.events; in race_events_exc()
118 WRITE_ONCE(run->kvm_dirty_regs, KVM_SYNC_X86_EVENTS); in race_events_exc()
136 struct kvm_run *run = (struct kvm_run *)arg; in race_sregs_cr4() local
137 __u64 *cr4 = &run->s.regs.sregs.cr4; in race_sregs_cr4()
142 WRITE_ONCE(run->kvm_dirty_regs, KVM_SYNC_X86_SREGS); in race_sregs_cr4()
161 struct kvm_run *run; in race_sync_regs() local
167 run = vcpu->run; in race_sync_regs()
169 run->kvm_valid_regs = KVM_SYNC_X86_SREGS; in race_sync_regs()
171 run->kvm_valid_regs = 0; in race_sync_regs()
180 TEST_ASSERT((run->s.regs.sregs.cr4 & X86_CR4_PAE) && in race_sync_regs()
181 (run->s.regs.sregs.efer & EFER_LME), in race_sync_regs()
183 !!(run->s.regs.sregs.cr4 & X86_CR4_PAE), in race_sync_regs()
184 !!(run->s.regs.sregs.efer & EFER_LME)); in race_sync_regs()
186 TEST_ASSERT_EQ(pthread_create(&thread, NULL, racer, (void *)run), 0); in race_sync_regs()
195 if (!__vcpu_run(vcpu) && run->exit_reason == KVM_EXIT_SHUTDOWN) in race_sync_regs()
215 struct kvm_run *run; in main() local
227 run = vcpu->run; in main()
230 run->kvm_valid_regs = INVALID_SYNC_FIELD; in main()
235 run->kvm_valid_regs = 0; in main()
237 run->kvm_valid_regs = INVALID_SYNC_FIELD | TEST_SYNC_FIELDS; in main()
242 run->kvm_valid_regs = 0; in main()
245 run->kvm_dirty_regs = INVALID_SYNC_FIELD; in main()
250 run->kvm_dirty_regs = 0; in main()
252 run->kvm_dirty_regs = INVALID_SYNC_FIELD | TEST_SYNC_FIELDS; in main()
257 run->kvm_dirty_regs = 0; in main()
261 run->kvm_valid_regs = TEST_SYNC_FIELDS; in main()
266 compare_regs(®s, &run->s.regs.regs); in main()
269 compare_sregs(&sregs, &run->s.regs.sregs); in main()
272 compare_vcpu_events(&events, &run->s.regs.events); in main()
275 run->s.regs.regs.rbx = 0xBAD1DEA; in main()
276 run->s.regs.sregs.apic_base = 1 << 11; in main()
279 run->kvm_valid_regs = TEST_SYNC_FIELDS; in main()
280 run->kvm_dirty_regs = KVM_SYNC_X86_REGS | KVM_SYNC_X86_SREGS; in main()
283 TEST_ASSERT(run->s.regs.regs.rbx == 0xBAD1DEA + 1, in main()
285 run->s.regs.regs.rbx); in main()
286 TEST_ASSERT(run->s.regs.sregs.apic_base == 1 << 11, in main()
288 run->s.regs.sregs.apic_base); in main()
291 compare_regs(®s, &run->s.regs.regs); in main()
294 compare_sregs(&sregs, &run->s.regs.sregs); in main()
297 compare_vcpu_events(&events, &run->s.regs.events); in main()
302 run->kvm_valid_regs = TEST_SYNC_FIELDS; in main()
303 run->kvm_dirty_regs = 0; in main()
304 run->s.regs.regs.rbx = 0xDEADBEEF; in main()
307 TEST_ASSERT(run->s.regs.regs.rbx != 0xDEADBEEF, in main()
309 run->s.regs.regs.rbx); in main()
315 run->kvm_valid_regs = 0; in main()
316 run->kvm_dirty_regs = 0; in main()
317 run->s.regs.regs.rbx = 0xAAAA; in main()
322 TEST_ASSERT(run->s.regs.regs.rbx == 0xAAAA, in main()
324 run->s.regs.regs.rbx); in main()
334 run->kvm_valid_regs = 0; in main()
335 run->kvm_dirty_regs = TEST_SYNC_FIELDS; in main()
336 run->s.regs.regs.rbx = 0xBBBB; in main()
339 TEST_ASSERT(run->s.regs.regs.rbx == 0xBBBB, in main()
341 run->s.regs.regs.rbx); in main()