Skip to content

Commit 8265770

Browse files
mingqiangchiwenlingz
authored andcommitted
hv:Change acrn_vhm_vector to static
-- Change acrn_vhm_vector to static, only used in io_request.c -- Add set_vhm_vector() api, it will call this api instead of acrn_vhm_vector except io_request.c Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent b22c8b6 commit 8265770

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

hypervisor/common/hypercall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ int32_t hcall_set_callback_vector(const struct acrn_vm *vm, uint64_t param)
11381138
pr_err("%s: Invalid passed vector\n");
11391139
ret = -EINVAL;
11401140
} else {
1141-
acrn_vhm_vector = (uint32_t)param;
1141+
set_vhm_vector((uint32_t)param);
11421142
ret = 0;
11431143
}
11441144

hypervisor/common/io_request.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#define ACRN_DBG_IOREQUEST 6U
99

10-
uint32_t acrn_vhm_vector = VECTOR_VIRT_IRQ_VHM;
10+
static uint32_t acrn_vhm_vector = VECTOR_VIRT_IRQ_VHM;
1111

1212
static void fire_vhm_interrupt(void)
1313
{
@@ -195,3 +195,8 @@ void set_vhm_req_state(struct acrn_vm *vm, uint16_t vhm_req_id, uint32_t state)
195195
clac();
196196
}
197197
}
198+
199+
void set_vhm_vector(uint32_t vector)
200+
{
201+
acrn_vhm_vector = vector;
202+
}

hypervisor/include/arch/x86/ioreq.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ uint32_t get_vhm_req_state(struct acrn_vm *vm, uint16_t vhm_req_id);
316316
*/
317317
void set_vhm_req_state(struct acrn_vm *vm, uint16_t vhm_req_id, uint32_t state);
318318

319+
/**
320+
* @brief Set the vector for HV callback VHM
321+
*
322+
* @param vector vector for HV callback VHM
323+
* @return None
324+
*/
325+
void set_vhm_vector(uint32_t vector);
326+
319327
/**
320328
* @}
321329
*/

hypervisor/include/arch/x86/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ void interrupt_init(uint16_t pcpu_id);
244244

245245
void cancel_event_injection(struct acrn_vcpu *vcpu);
246246

247-
extern uint32_t acrn_vhm_vector;
248247
extern uint64_t irq_alloc_bitmap[IRQ_ALLOC_BITMAP_SIZE];
249248

250249
/**

0 commit comments

Comments
 (0)