aboutsummaryrefslogtreecommitdiff
path: root/target-i386/helper.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-27 01:52:00 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-27 01:52:00 +0000
commit526216880d5c4cb2507bdb22d6a5d33016f38104 (patch)
treececf0b1407ea31e6a0814714d1e0faf432113b16 /target-i386/helper.c
parent40d0591e2c4922f545ebf1c9a3bd89e73e8428b4 (diff)
downloadqemu-526216880d5c4cb2507bdb22d6a5d33016f38104.zip
qemu-526216880d5c4cb2507bdb22d6a5d33016f38104.tar.gz
qemu-526216880d5c4cb2507bdb22d6a5d33016f38104.tar.bz2
SVM VINTR fix, by Alexander Graf.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3248 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 40dc41f..91fd6a9 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -4120,8 +4120,9 @@ void helper_vmrun(target_ulong addr)
if (loglevel & CPU_LOG_TB_IN_ASM)
fprintf(logfile, " %#x %#x\n", env->exception_index, env->error_code);
}
- if (int_ctl & V_IRQ_MASK)
+ if ((int_ctl & V_IRQ_MASK) || (env->intercept & INTERCEPT_VINTR)) {
env->interrupt_request |= CPU_INTERRUPT_VIRQ;
+ }
cpu_loop_exit();
}
@@ -4283,6 +4284,13 @@ void vmexit(uint64_t exit_code, uint64_t exit_info_1)
ldq_phys(env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2)),
EIP);
+ if(env->hflags & HF_INHIBIT_IRQ_MASK) {
+ stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_state), SVM_INTERRUPT_SHADOW_MASK);
+ env->hflags &= ~HF_INHIBIT_IRQ_MASK;
+ } else {
+ stl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_state), 0);
+ }
+
/* Save the VM state in the vmcb */
SVM_SAVE_SEG(env->vm_vmcb, segs[R_ES], es);
SVM_SAVE_SEG(env->vm_vmcb, segs[R_CS], cs);