hv: sched: add kick_thread to support notification

kick means to notify one thread_object. If the target thread object is
running, send a IPI to notify it; if the target thread object is
runnable, make reschedule on it.

Also add kick_vcpu API in vcpu layer to notify vcpu.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shuo A Liu
2019-06-18 17:49:56 +08:00
committed by wenlingz
parent 810305be98
commit 5f8e7a6cb7
5 changed files with 36 additions and 14 deletions

View File

@@ -598,6 +598,11 @@ void offline_vcpu(struct acrn_vcpu *vcpu)
vcpu->state = VCPU_OFFLINE;
}
void kick_vcpu(const struct acrn_vcpu *vcpu)
{
kick_thread(&vcpu->thread_obj);
}
/*
* @pre (&vcpu->stack[CONFIG_STACK_SIZE] & (CPU_STACK_ALIGN - 1UL)) == 0
*/