Lines Matching +full:- +full:v
65 timer->index = index; in stimer_init()
74 svcpu->vcpu = vcpu; in synic_enable()
75 svcpu->msg_page = synic_alloc_page(); in synic_enable()
76 for (i = 0; i < ARRAY_SIZE(svcpu->timer); i++) { in synic_enable()
77 stimer_init(&svcpu->timer[i], i); in synic_enable()
79 wrmsr(HV_X64_MSR_SIMP, (u64)virt_to_phys(svcpu->msg_page) | in synic_enable()
86 wrmsr(HV_X64_MSR_STIMER0_CONFIG + 2*timer->index, 0); in stimer_shutdown()
91 atomic_inc(&timer->fire_count); in process_stimer_expired()
98 (struct hv_timer_message_payload *)msg->u.payload; in process_stimer_msg()
101 if (msg->header.message_type != HVMSG_TIMER_EXPIRED && in process_stimer_msg()
102 msg->header.message_type != HVMSG_NONE) { in process_stimer_msg()
103 report_fail("invalid Hyper-V SynIC msg type"); in process_stimer_msg()
108 if (msg->header.message_type == HVMSG_NONE) { in process_stimer_msg()
112 if (msg->header.payload_size < sizeof(*payload)) { in process_stimer_msg()
113 report_fail("invalid Hyper-V SynIC msg payload size"); in process_stimer_msg()
120 if (payload->timer_index >= ARRAY_SIZE(svcpu->timer)) { in process_stimer_msg()
121 report_fail("invalid Hyper-V SynIC timer index"); in process_stimer_msg()
125 timer = &svcpu->timer[payload->timer_index]; in process_stimer_msg()
127 if (timer->direct) { in process_stimer_msg()
135 msg->header.message_type = HVMSG_NONE; in process_stimer_msg()
137 if (msg->header.message_flags.msg_pending) { in process_stimer_msg()
150 msg_page = (struct hv_message_page *)svcpu->msg_page; in __stimer_isr()
151 for (i = 0; i < ARRAY_SIZE(msg_page->sint_message); i++) { in __stimer_isr()
152 msg = &msg_page->sint_message[i]; in __stimer_isr()
175 struct stimer *timer = &svcpu->timer[timer_index]; in __stimer_isr_direct()
205 atomic_set(&timer->fire_count, 0); in stimer_start()
210 if (!timer->direct) { in stimer_start()
211 config.sintx = timer->sint; in stimer_start()
214 config.apic_vector = timer->apic_vec; in stimer_start()
224 wrmsr(HV_X64_MSR_STIMER0_COUNT + timer->index*2, count); in stimer_start()
225 wrmsr(HV_X64_MSR_STIMER0_CONFIG + timer->index*2, config.as_uint64); in stimer_start()
227 wrmsr(HV_X64_MSR_STIMER0_CONFIG + timer->index*2, config.as_uint64); in stimer_start()
228 wrmsr(HV_X64_MSR_STIMER0_COUNT + timer->index*2, count); in stimer_start()
237 for (i = 0; i < ARRAY_SIZE(svcpu->timer); i++) { in stimers_shutdown()
238 stimer_shutdown(&svcpu->timer[i]); in stimers_shutdown()
250 synic_free_page(svcpu->msg_page); in synic_disable()
266 timer1 = &svcpu->timer[0]; in stimer_test_prepare()
267 timer2 = &svcpu->timer[1]; in stimer_test_prepare()
269 timer1->sint = SINT1_NUM; in stimer_test_prepare()
270 timer2->sint = SINT2_NUM; in stimer_test_prepare()
281 timer1 = &svcpu->timer[0]; in stimer_test_prepare_direct()
282 timer2 = &svcpu->timer[1]; in stimer_test_prepare_direct()
287 timer1->apic_vec = APIC_VEC1; in stimer_test_prepare_direct()
288 timer2->apic_vec = APIC_VEC2; in stimer_test_prepare_direct()
290 timer1->direct = true; in stimer_test_prepare_direct()
291 timer2->direct = true; in stimer_test_prepare_direct()
301 while ((atomic_read(&timer1->fire_count) < 1000) || in stimer_test_periodic()
302 (atomic_read(&timer2->fire_count) < 1000)) { in stimer_test_periodic()
305 report_pass("Hyper-V SynIC periodic timers test vcpu %d", vcpu); in stimer_test_periodic()
312 /* Check one-shot timer */ in stimer_test_one_shot()
314 while (atomic_read(&timer->fire_count) < 1) { in stimer_test_one_shot()
317 report_pass("Hyper-V SynIC one-shot test vcpu %d", vcpu); in stimer_test_one_shot()
323 /* Check auto-enable one-shot timer */ in stimer_test_auto_enable_one_shot()
325 while (atomic_read(&timer->fire_count) < 1) { in stimer_test_auto_enable_one_shot()
328 report_pass("Hyper-V SynIC auto-enable one-shot timer test vcpu %d", vcpu); in stimer_test_auto_enable_one_shot()
334 /* Check auto-enable periodic timer */ in stimer_test_auto_enable_periodic()
336 while (atomic_read(&timer->fire_count) < 1000) { in stimer_test_auto_enable_periodic()
339 report_pass("Hyper-V SynIC auto-enable periodic timer test vcpu %d", vcpu); in stimer_test_auto_enable_periodic()
349 if (timer->direct) in stimer_test_one_shot_busy()
353 msg = &msg_page->sint_message[timer->sint]; in stimer_test_one_shot_busy()
355 msg->header.message_type = HVMSG_TIMER_EXPIRED; in stimer_test_one_shot_busy()
362 while (!msg->header.message_flags.msg_pending); in stimer_test_one_shot_busy()
364 report(!atomic_read(&timer->fire_count), in stimer_test_one_shot_busy()
367 msg->header.message_type = HVMSG_NONE; in stimer_test_one_shot_busy()
371 while (atomic_read(&timer->fire_count) < 1) { in stimer_test_one_shot_busy()
387 timer1 = &svcpu->timer[0]; in stimer_test()
388 timer2 = &svcpu->timer[1]; in stimer_test()
425 printf("Starting Hyper-V SynIC timers tests: message mode\n"); in stimer_test_all()
434 printf("Starting Hyper-V SynIC timers tests: direct mode\n"); in stimer_test_all()
450 report_skip("Hyper-V SynIC is not supported"); in main()
455 report_skip("Hyper-V SynIC timers are not supported"); in main()
460 report_skip("Hyper-V time reference counter is not supported"); in main()
465 report_skip("Hyper-V SinIC timer direct mode is not supported"); in main()