hv: revert NMI notification by INIT signal

NMI is used to notify LAPIC-PT RTVM, to kick its CPU into hypervisor.
But NMI could be used by system devices, like PMU (Performance Monitor
Unit). So use INIT signal as the partition CPU notification function, to
replace injecting NMI.

Also remove unused NMI as notification related code.

Tracked-On: #6966
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
This commit is contained in:
Minggui Cao
2021-12-17 14:02:01 +08:00
committed by acrnsi-robot
parent b72202e976
commit 3b1deda0eb
11 changed files with 53 additions and 102 deletions

View File

@@ -125,7 +125,7 @@ struct thread_object *sched_get_current(uint16_t pcpu_id)
}
/**
* @pre delmode == DEL_MODE_IPI || delmode == DEL_MODE_NMI
* @pre delmode == DEL_MODE_IPI || delmode == DEL_MODE_INIT
*/
void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode)
{
@@ -137,8 +137,8 @@ void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode)
case DEL_MODE_IPI:
send_single_ipi(pcpu_id, NOTIFY_VCPU_VECTOR);
break;
case DEL_MODE_NMI:
send_single_nmi(pcpu_id);
case DEL_MODE_INIT:
send_single_init(pcpu_id);
break;
default:
ASSERT(false, "Unknown delivery mode %u for pCPU%u", delmode, pcpu_id);
@@ -202,8 +202,8 @@ void sleep_thread(struct thread_object *obj)
scheduler->sleep(obj);
}
if (is_running(obj)) {
if (obj->notify_mode == SCHED_NOTIFY_NMI) {
make_reschedule_request(pcpu_id, DEL_MODE_NMI);
if (obj->notify_mode == SCHED_NOTIFY_INIT) {
make_reschedule_request(pcpu_id, DEL_MODE_INIT);
} else {
make_reschedule_request(pcpu_id, DEL_MODE_IPI);
}