Lines Matching refs:hv_context
37 struct hv_context hv_context = { variable
98 void *hypercall_page = hv_context.hypercall_page; in do_hypercall()
140 struct ms_hyperv_tsc_page *tsc_pg = hv_context.tsc_page; in read_hv_clock_tsc()
199 memset(hv_context.synic_event_page, 0, sizeof(void *) * NR_CPUS); in hv_init()
200 memset(hv_context.synic_message_page, 0, in hv_init()
202 memset(hv_context.post_msg_page, 0, in hv_init()
204 memset(hv_context.vp_index, 0, in hv_init()
206 memset(hv_context.event_dpc, 0, in hv_init()
208 memset(hv_context.clk_evt, 0, in hv_init()
216 hv_context.guestid = generate_guest_id(0, LINUX_VERSION_CODE, 0); in hv_init()
217 wrmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid); in hv_init()
239 hv_context.hypercall_page = virtaddr; in hv_init()
246 hv_context.tsc_page = va_tsc; in hv_init()
284 if (hv_context.hypercall_page) { in hv_cleanup()
287 vfree(hv_context.hypercall_page); in hv_cleanup()
288 hv_context.hypercall_page = NULL; in hv_cleanup()
301 vfree(hv_context.tsc_page); in hv_cleanup()
302 hv_context.tsc_page = NULL; in hv_cleanup()
324 hv_context.post_msg_page[get_cpu()]; in hv_post_message()
412 hv_context.hv_numa_map = kzalloc(sizeof(struct cpumask) * nr_node_ids, in hv_synic_alloc()
414 if (hv_context.hv_numa_map == NULL) { in hv_synic_alloc()
420 hv_context.event_dpc[cpu] = kmalloc(size, GFP_ATOMIC); in hv_synic_alloc()
421 if (hv_context.event_dpc[cpu] == NULL) { in hv_synic_alloc()
425 tasklet_init(hv_context.event_dpc[cpu], vmbus_on_event, cpu); in hv_synic_alloc()
427 hv_context.clk_evt[cpu] = kzalloc(ced_size, GFP_ATOMIC); in hv_synic_alloc()
428 if (hv_context.clk_evt[cpu] == NULL) { in hv_synic_alloc()
433 hv_init_clockevent_device(hv_context.clk_evt[cpu], cpu); in hv_synic_alloc()
435 hv_context.synic_message_page[cpu] = in hv_synic_alloc()
438 if (hv_context.synic_message_page[cpu] == NULL) { in hv_synic_alloc()
443 hv_context.synic_event_page[cpu] = in hv_synic_alloc()
446 if (hv_context.synic_event_page[cpu] == NULL) { in hv_synic_alloc()
451 hv_context.post_msg_page[cpu] = in hv_synic_alloc()
454 if (hv_context.post_msg_page[cpu] == NULL) { in hv_synic_alloc()
467 kfree(hv_context.event_dpc[cpu]); in hv_synic_free_cpu()
468 kfree(hv_context.clk_evt[cpu]); in hv_synic_free_cpu()
469 if (hv_context.synic_event_page[cpu]) in hv_synic_free_cpu()
470 free_page((unsigned long)hv_context.synic_event_page[cpu]); in hv_synic_free_cpu()
471 if (hv_context.synic_message_page[cpu]) in hv_synic_free_cpu()
472 free_page((unsigned long)hv_context.synic_message_page[cpu]); in hv_synic_free_cpu()
473 if (hv_context.post_msg_page[cpu]) in hv_synic_free_cpu()
474 free_page((unsigned long)hv_context.post_msg_page[cpu]); in hv_synic_free_cpu()
481 kfree(hv_context.hv_numa_map); in hv_synic_free()
504 if (!hv_context.hypercall_page) in hv_synic_init()
513 simp.base_simp_gpa = virt_to_phys(hv_context.synic_message_page[cpu]) in hv_synic_init()
521 siefp.base_siefp_gpa = virt_to_phys(hv_context.synic_event_page[cpu]) in hv_synic_init()
542 hv_context.synic_initialized = true; in hv_synic_init()
550 hv_context.vp_index[cpu] = (u32)vp_index; in hv_synic_init()
552 INIT_LIST_HEAD(&hv_context.percpu_list[cpu]); in hv_synic_init()
558 clockevents_config_and_register(hv_context.clk_evt[cpu], in hv_synic_init()
576 clockevents_unbind_device(hv_context.clk_evt[cpu], cpu); in hv_synic_clockevents_cleanup()
590 if (!hv_context.synic_initialized) in hv_synic_cleanup()
595 hv_ce_shutdown(hv_context.clk_evt[cpu]); in hv_synic_cleanup()