diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index 99df13bd9..6a2df2ac8 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -1138,7 +1138,7 @@ int32_t hcall_set_callback_vector(const struct acrn_vm *vm, uint64_t param) pr_err("%s: Invalid passed vector\n"); ret = -EINVAL; } else { - acrn_vhm_vector = (uint32_t)param; + set_vhm_vector((uint32_t)param); ret = 0; } diff --git a/hypervisor/common/io_request.c b/hypervisor/common/io_request.c index ed8bf6100..fe471653a 100644 --- a/hypervisor/common/io_request.c +++ b/hypervisor/common/io_request.c @@ -7,7 +7,7 @@ #define ACRN_DBG_IOREQUEST 6U -uint32_t acrn_vhm_vector = VECTOR_VIRT_IRQ_VHM; +static uint32_t acrn_vhm_vector = VECTOR_VIRT_IRQ_VHM; static void fire_vhm_interrupt(void) { @@ -195,3 +195,8 @@ void set_vhm_req_state(struct acrn_vm *vm, uint16_t vhm_req_id, uint32_t state) clac(); } } + +void set_vhm_vector(uint32_t vector) +{ + acrn_vhm_vector = vector; +} diff --git a/hypervisor/include/arch/x86/ioreq.h b/hypervisor/include/arch/x86/ioreq.h index 6ea5d37bc..66cbf9384 100644 --- a/hypervisor/include/arch/x86/ioreq.h +++ b/hypervisor/include/arch/x86/ioreq.h @@ -316,6 +316,14 @@ uint32_t get_vhm_req_state(struct acrn_vm *vm, uint16_t vhm_req_id); */ void set_vhm_req_state(struct acrn_vm *vm, uint16_t vhm_req_id, uint32_t state); +/** + * @brief Set the vector for HV callback VHM + * + * @param vector vector for HV callback VHM + * @return None + */ +void set_vhm_vector(uint32_t vector); + /** * @} */ diff --git a/hypervisor/include/arch/x86/irq.h b/hypervisor/include/arch/x86/irq.h index 4c37f2a27..652e58239 100644 --- a/hypervisor/include/arch/x86/irq.h +++ b/hypervisor/include/arch/x86/irq.h @@ -244,7 +244,6 @@ void interrupt_init(uint16_t pcpu_id); void cancel_event_injection(struct acrn_vcpu *vcpu); -extern uint32_t acrn_vhm_vector; extern uint64_t irq_alloc_bitmap[IRQ_ALLOC_BITMAP_SIZE]; /**