Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.

Commit b00b798

Browse files
committed
Optimization: Moved tunnel updates outside guest-execution loop
Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
1 parent b6733f4 commit b00b798

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

core/cpu.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,6 @@ int cpu_vmx_execute(struct vcpu_t *vcpu, struct hax_tunnel *htun)
353353
*/
354354
hax_handle_idt_vectoring(vcpu);
355355

356-
if (vcpu->nr_pending_intrs > 0 || hax_intr_is_blocked(vcpu))
357-
htun->ready_for_interrupt_injection = 0;
358-
else
359-
htun->ready_for_interrupt_injection = 1;
360-
361356
vcpu->cur_state = GS_STALE;
362357
vmcs_err = put_vmcs(vcpu, &flags);
363358
if (vmcs_err) {

core/vcpu.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,15 @@ int vcpu_execute(struct vcpu_t *vcpu)
16851685
}
16861686
err = cpu_vmx_execute(vcpu, htun);
16871687
vcpu_is_panic(vcpu);
1688+
1689+
if (vcpu->nr_pending_intrs > 0 || hax_intr_is_blocked(vcpu))
1690+
htun->ready_for_interrupt_injection = 0;
1691+
else
1692+
htun->ready_for_interrupt_injection = 1;
1693+
1694+
if (htun->_exit_status == HAX_EXIT_HLT)
1695+
htun->ready_for_interrupt_injection = 1;
1696+
16881697
out:
16891698
if (err) {
16901699
vcpu->cur_state = GS_STALE;
@@ -2729,7 +2738,6 @@ static int exit_hlt(struct vcpu_t *vcpu, struct hax_tunnel *htun)
27292738
if (hax_valid_vector(vector))
27302739
return HAX_RESUME;
27312740

2732-
htun->ready_for_interrupt_injection = 1;
27332741
return HAX_EXIT;
27342742
}
27352743

0 commit comments

Comments
 (0)