aboutsummaryrefslogtreecommitdiff
path: root/target/i386/hvf/hvf.c
diff options
context:
space:
mode:
authorCameron Esfahani <dirty@apple.com>2019-12-02 15:55:41 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2019-12-03 09:11:42 +0100
commit64bef038e777208e4c35beae7f980fbd994b87eb (patch)
tree9ab8fa418b38c20013700ff8958e36c75f26d921 /target/i386/hvf/hvf.c
parent39032981fa851d25fb27527f25f046fed800e585 (diff)
downloadqemu-64bef038e777208e4c35beae7f980fbd994b87eb.zip
qemu-64bef038e777208e4c35beae7f980fbd994b87eb.tar.gz
qemu-64bef038e777208e4c35beae7f980fbd994b87eb.tar.bz2
hvf: correctly inject VMCS_INTR_T_HWINTR versus VMCS_INTR_T_SWINTR.
Previous implementation in hvf_inject_interrupts() would always inject VMCS_INTR_T_SWINTR even when VMCS_INTR_T_HWINTR was required. Now correctly determine when VMCS_INTR_T_HWINTR is appropriate versus VMCS_INTR_T_SWINTR. Make sure to clear ins_len and has_error_code when ins_len isn't valid and error_code isn't set. Signed-off-by: Cameron Esfahani <dirty@apple.com> Message-Id: <bf8d945ea1b423786d7802bbcf769517d1fd01f8.1575330463.git.dirty@apple.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/hvf/hvf.c')
-rw-r--r--target/i386/hvf/hvf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 784e67d..d72543d 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -637,6 +637,8 @@ static void hvf_store_events(CPUState *cpu, uint32_t ins_len, uint64_t idtvec_in
env->exception_injected = 0;
env->interrupt_injected = -1;
env->nmi_injected = false;
+ env->ins_len = 0;
+ env->has_error_code = false;
if (idtvec_info & VMCS_IDT_VEC_VALID) {
switch (idtvec_info & VMCS_IDT_VEC_TYPE) {
case VMCS_IDT_VEC_HWINTR:
@@ -659,7 +661,7 @@ static void hvf_store_events(CPUState *cpu, uint32_t ins_len, uint64_t idtvec_in
(idtvec_info & VMCS_IDT_VEC_TYPE) == VMCS_IDT_VEC_SWINTR) {
env->ins_len = ins_len;
}
- if (idtvec_info & VMCS_INTR_DEL_ERRCODE) {
+ if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) {
env->has_error_code = true;
env->error_code = rvmcs(cpu->hvf_fd, VMCS_IDT_VECTORING_ERROR);
}