Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || | ||||
* Directly schedule the event software interrupt on | * Directly schedule the event software interrupt on | ||||
* current cpu. | * current cpu. | ||||
*/ | */ | ||||
hv_vmbus_on_events(cpu); | hv_vmbus_on_events(cpu); | ||||
} | } | ||||
/* Check if there are actual msgs to be process */ | /* Check if there are actual msgs to be process */ | ||||
page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; | page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; | ||||
msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; | msg = (hv_vmbus_message*) page_addr + HV_VMBUS_TIMER_SINT; | ||||
/* we call eventtimer process the message */ | /* we call eventtimer process the message */ | ||||
if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { | if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { | ||||
msg->header.message_type = HV_MESSAGE_TYPE_NONE; | msg->header.message_type = HV_MESSAGE_TYPE_NONE; | ||||
/* call intrrupt handler of event timer */ | |||||
hv_et_intr(frame); | |||||
/* | /* | ||||
* Make sure the write to message_type (ie set to | * Make sure the write to message_type (ie set to | ||||
* HV_MESSAGE_TYPE_NONE) happens before we read the | * HV_MESSAGE_TYPE_NONE) happens before we read the | ||||
* message_pending and EOMing. Otherwise, the EOMing will | * message_pending and EOMing. Otherwise, the EOMing will | ||||
* not deliver any more messages | * not deliver any more messages | ||||
* since there is no empty slot | * since there is no empty slot | ||||
*/ | */ | ||||
atomic_thread_fence_seq_cst(); | atomic_thread_fence_seq_cst(); | ||||
if (msg->header.message_flags.u.message_pending) { | if (msg->header.message_flags.u.message_pending) { | ||||
/* | /* | ||||
* This will cause message queue rescan to possibly | * This will cause message queue rescan to possibly | ||||
* deliver another msg from the hypervisor | * deliver another msg from the hypervisor | ||||
*/ | */ | ||||
wrmsr(HV_X64_MSR_EOM, 0); | wrmsr(HV_X64_MSR_EOM, 0); | ||||
} | } | ||||
hv_et_intr(frame); | |||||
return (FILTER_HANDLED); | |||||
} | } | ||||
msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; | |||||
if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { | if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { | ||||
swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); | swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); | ||||
} | } | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
u_long *hv_vmbus_intr_cpu[MAXCPU]; | u_long *hv_vmbus_intr_cpu[MAXCPU]; | ||||
▲ Show 20 Lines • Show All 545 Lines • Show Last 20 Lines |