Skip to content

Commit 4607177

Browse files
JasonChenCJlijinxia
authored andcommitted
replace pending_intr with pending_req
the pending_intr is not only serving for interrupt but also for different request including TLB & TMR updating, so change the function & variants name accordingly. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 7003e50 commit 4607177

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

hypervisor/arch/x86/interrupt.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ static bool vcpu_pending_request(struct vcpu *vcpu)
111111
vcpu_make_request(vcpu, ACRN_REQUEST_EVENT);
112112
}
113113

114-
return vcpu->arch_vcpu.pending_intr != 0;
114+
return vcpu->arch_vcpu.pending_req != 0;
115115
}
116116

117117
int vcpu_make_request(struct vcpu *vcpu, int eventid)
118118
{
119-
bitmap_set(eventid, &vcpu->arch_vcpu.pending_intr);
119+
bitmap_set(eventid, &vcpu->arch_vcpu.pending_req);
120120
/*
121121
* if current hostcpu is not the target vcpu's hostcpu, we need
122122
* to invoke IPI to wake up target vcpu
@@ -255,7 +255,7 @@ int interrupt_window_vmexit_handler(struct vcpu *vcpu)
255255

256256
if (vcpu_pending_request(vcpu)) {
257257
/* Do nothing
258-
* acrn_do_intr_process will continue for this vcpu
258+
* acrn_handle_pending_request will continue for this vcpu
259259
*/
260260
} else {
261261
/* No interrupts to inject.
@@ -296,18 +296,18 @@ int external_interrupt_vmexit_handler(struct vcpu *vcpu)
296296
return 0;
297297
}
298298

299-
int acrn_do_intr_process(struct vcpu *vcpu)
299+
int acrn_handle_pending_request(struct vcpu *vcpu)
300300
{
301301
int ret = 0;
302302
int vector;
303303
int tmp;
304304
bool intr_pending = false;
305-
uint64_t *pending_intr_bits = &vcpu->arch_vcpu.pending_intr;
305+
uint64_t *pending_req_bits = &vcpu->arch_vcpu.pending_req;
306306

307-
if (bitmap_test_and_clear(ACRN_REQUEST_TLB_FLUSH, pending_intr_bits))
307+
if (bitmap_test_and_clear(ACRN_REQUEST_TLB_FLUSH, pending_req_bits))
308308
invept(vcpu);
309309

310-
if (bitmap_test_and_clear(ACRN_REQUEST_TMR_UPDATE, pending_intr_bits))
310+
if (bitmap_test_and_clear(ACRN_REQUEST_TMR_UPDATE, pending_req_bits))
311311
vioapic_update_tmr(vcpu);
312312

313313
/* handling cancelled event injection when vcpu is switched out */
@@ -353,7 +353,7 @@ int acrn_do_intr_process(struct vcpu *vcpu)
353353

354354
/* Do pending interrupts process */
355355
/* TODO: checkin NMI intr windows before inject */
356-
if (bitmap_test_and_clear(ACRN_REQUEST_NMI, pending_intr_bits)) {
356+
if (bitmap_test_and_clear(ACRN_REQUEST_NMI, pending_req_bits)) {
357357
/* Inject NMI vector = 2 */
358358
exec_vmwrite(VMX_ENTRY_INT_INFO_FIELD,
359359
VMX_INT_INFO_VALID | (VMX_INT_TYPE_NMI << 8) | IDT_NMI);
@@ -370,23 +370,23 @@ int acrn_do_intr_process(struct vcpu *vcpu)
370370
if (is_guest_irq_enabled(vcpu)) {
371371
/* Inject external interrupt first */
372372
if (bitmap_test_and_clear(ACRN_REQUEST_EXTINT,
373-
pending_intr_bits)) {
373+
pending_req_bits)) {
374374
/* has pending external interrupts */
375375
ret = vcpu_do_pending_extint(vcpu);
376376
goto INTR_WIN;
377377
}
378378

379379
/* Inject vLAPIC vectors */
380380
if (bitmap_test_and_clear(ACRN_REQUEST_EVENT,
381-
pending_intr_bits)) {
381+
pending_req_bits)) {
382382
/* has pending vLAPIC interrupts */
383383
ret = vcpu_do_pending_event(vcpu);
384384
goto INTR_WIN;
385385
}
386386
}
387387

388388
/* Inject GP event */
389-
if (bitmap_test_and_clear(ACRN_REQUEST_GP, pending_intr_bits)) {
389+
if (bitmap_test_and_clear(ACRN_REQUEST_GP, pending_req_bits)) {
390390
/* has pending GP interrupts */
391391
ret = vcpu_do_pending_gp(vcpu);
392392
goto INTR_WIN;
@@ -416,7 +416,7 @@ void cancel_event_injection(struct vcpu *vcpu)
416416
/*
417417
* If event is injected, we clear VMX_ENTRY_INT_INFO_FIELD,
418418
* save injection info, and mark inject event pending.
419-
* The event will be re-injected in next acrn_do_intr_process
419+
* The event will be re-injected in next acrn_handle_pending_request
420420
* call.
421421
*/
422422
if (intinfo & VMX_INT_INFO_VALID) {

hypervisor/common/hv_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ void vcpu_thread(struct vcpu *vcpu)
6363
exec_softirq();
6464
CPU_IRQ_DISABLE();
6565

66-
/* Check and process interrupts */
67-
acrn_do_intr_process(vcpu);
66+
/* Check and process pending requests(including interrupt) */
67+
acrn_handle_pending_request(vcpu);
6868

6969
if (need_rescheduled(vcpu->pcpu_id)) {
7070
/*

hypervisor/include/arch/x86/guest/vcpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ struct vcpu_arch {
225225
uint32_t sipi_vector;
226226

227227
/* interrupt injection information */
228-
uint64_t pending_intr;
228+
uint64_t pending_req;
229229
bool inject_event_pending;
230230
struct event_injection_info inject_info;
231231

hypervisor/include/arch/x86/irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ int vcpu_make_request(struct vcpu *vcpu, int eventid);
189189
int exception_vmexit_handler(struct vcpu *vcpu);
190190
int interrupt_window_vmexit_handler(struct vcpu *vcpu);
191191
int external_interrupt_vmexit_handler(struct vcpu *vcpu);
192-
int acrn_do_intr_process(struct vcpu *vcpu);
192+
int acrn_handle_pending_request(struct vcpu *vcpu);
193193
int interrupt_init(uint32_t logical_id);
194194

195195
void cancel_event_injection(struct vcpu *vcpu);

0 commit comments

Comments
 (0)