[PATCH v5 5/5] HV: Remove INIT signal notification related code


Kaige Fu
 

We don't use INIT signal notification method now. This patch
removes them.

Signed-off-by: Kaige Fu <kaige.fu@...>
---
hypervisor/arch/x86/guest/vmexit.c | 21 +--------------------
hypervisor/arch/x86/lapic.c | 20 --------------------
hypervisor/common/schedule.c | 5 +----
hypervisor/include/arch/x86/lapic.h | 9 ---------
hypervisor/include/common/schedule.h | 4 +---
5 files changed, 3 insertions(+), 56 deletions(-)

diff --git a/hypervisor/arch/x86/guest/vmexit.c b/hypervisor/arch/x86/guest/vmexit.c
index 0f09741c..9c25f2f9 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] = {
@@ -377,21 +376,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 732036ec..bf680f84 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 73a6eda0..3ce6a411 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 9b59c21d..b345ff6b 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 809be686..15268658 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
};
--
2.20.0

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.