diff --git a/hypervisor/arch/x86/guest/vmexit.c b/hypervisor/arch/x86/guest/vmexit.c index 506a66cd6..ac73f4caa 100644 --- a/hypervisor/arch/x86/guest/vmexit.c +++ b/hypervisor/arch/x86/guest/vmexit.c @@ -30,7 +30,6 @@ static int32_t unhandled_vmexit_handler(struct acrn_vcpu *vcpu); static int32_t xsetbv_vmexit_handler(struct acrn_vcpu *vcpu); static int32_t wbinvd_vmexit_handler(struct acrn_vcpu *vcpu); static int32_t undefined_vmexit_handler(struct acrn_vcpu *vcpu); -static int32_t init_signal_vmexit_handler(__unused struct acrn_vcpu *vcpu); /* VM Dispatch table for Exit condition handling */ static const struct vm_exit_dispatch dispatch_table[NR_VMX_EXIT_REASONS] = { @@ -41,7 +40,7 @@ static const struct vm_exit_dispatch dispatch_table[NR_VMX_EXIT_REASONS] = { [VMX_EXIT_REASON_TRIPLE_FAULT] = { .handler = triple_fault_vmexit_handler}, [VMX_EXIT_REASON_INIT_SIGNAL] = { - .handler = init_signal_vmexit_handler}, + .handler = undefined_vmexit_handler}, [VMX_EXIT_REASON_STARTUP_IPI] = { .handler = unhandled_vmexit_handler}, [VMX_EXIT_REASON_IO_SMI] = { @@ -384,21 +383,3 @@ static int32_t undefined_vmexit_handler(struct acrn_vcpu *vcpu) vcpu_inject_ud(vcpu); return 0; } - -/* - * This handler is only triggered by INIT signal when poweroff from inside of RTVM - */ -static int32_t init_signal_vmexit_handler(__unused struct acrn_vcpu *vcpu) -{ - /* - * Intel SDM Volume 3, 25.2: - * INIT signals. INIT signals cause VM exits. A logical processer performs none - * of the operations normally associated with these events. Such exits do not modify - * register state or clear pending events as they would outside of VMX operation (If - * a logical processor is the wait-for-SIPI state, INIT signals are blocked. They do - * not cause VM exits in this case). - * - * So, it is safe to ignore the signal and reture here. - */ - return 0; -} diff --git a/hypervisor/arch/x86/lapic.c b/hypervisor/arch/x86/lapic.c index 732036ecd..bf680f842 100644 --- a/hypervisor/arch/x86/lapic.c +++ b/hypervisor/arch/x86/lapic.c @@ -274,26 +274,6 @@ void send_single_ipi(uint16_t pcpu_id, uint32_t vector) * * @return None */ -void send_single_init(uint16_t pcpu_id) -{ - union apic_icr icr; - - /* - * Intel SDM Vol3 23.8: - * The INIT signal is blocked whenever a logical processor is in VMX root operation. - * It is not blocked in VMX nonroot operation. Instead, INITs cause VM exits - */ - icr.value_32.hi_32 = per_cpu(lapic_id, pcpu_id); - icr.value_32.lo_32 = (INTR_LAPIC_ICR_PHYSICAL << 11U) | (INTR_LAPIC_ICR_INIT << 8U); - - msr_write(MSR_IA32_EXT_APIC_ICR, icr.value); -} - -/** - * @pre pcpu_id < CONFIG_MAX_PCPU_NUM - * - * @return None - */ void send_single_nmi(uint16_t pcpu_id) { union apic_icr icr; diff --git a/hypervisor/common/schedule.c b/hypervisor/common/schedule.c index 73a6eda06..3ce6a411b 100644 --- a/hypervisor/common/schedule.c +++ b/hypervisor/common/schedule.c @@ -123,7 +123,7 @@ struct thread_object *sched_get_current(uint16_t pcpu_id) } /** - * @pre delmode == DEL_MODE_IPI || delmode == DEL_MODE_INIT || delmode == DEL_MODE_NMI + * @pre delmode == DEL_MODE_IPI || delmode == DEL_MODE_NMI */ void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode) { @@ -135,9 +135,6 @@ void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode) case DEL_MODE_IPI: send_single_ipi(pcpu_id, VECTOR_NOTIFY_VCPU); break; - case DEL_MODE_INIT: - send_single_init(pcpu_id); - break; case DEL_MODE_NMI: send_single_nmi(pcpu_id); break; diff --git a/hypervisor/include/arch/x86/lapic.h b/hypervisor/include/arch/x86/lapic.h index 9b59c21d4..b345ff6b2 100644 --- a/hypervisor/include/arch/x86/lapic.h +++ b/hypervisor/include/arch/x86/lapic.h @@ -174,15 +174,6 @@ void send_single_ipi(uint16_t pcpu_id, uint32_t vector); */ /* End of ipi_ext_apis */ -/** - * @brief Send an INIT signal to a single pCPU - * - * @param[in] pcpu_id The id of destination physical cpu - * - * @return None - */ -void send_single_init(uint16_t pcpu_id); - /** * @brief Send an NMI signal to a single pCPU * diff --git a/hypervisor/include/common/schedule.h b/hypervisor/include/common/schedule.h index 809be6869..15268658a 100644 --- a/hypervisor/include/common/schedule.h +++ b/hypervisor/include/common/schedule.h @@ -12,9 +12,8 @@ #define NEED_RESCHEDULE (1U) -#define DEL_MODE_INIT (1U) +#define DEL_MODE_NMI (1U) #define DEL_MODE_IPI (2U) -#define DEL_MODE_NMI (3U) #define THREAD_DATA_SIZE (256U) @@ -25,7 +24,6 @@ enum thread_object_state { }; enum sched_notify_mode { - SCHED_NOTIFY_INIT, SCHED_NOTIFY_NMI, SCHED_NOTIFY_IPI };