提交 a0a07cd2 编写于 作者: G Gleb Natapov 提交者: Avi Kivity

KVM: SVM: do not generate "external interrupt exit" if other exit is pending

Nested SVM checks for external interrupt after injecting nested exception.
In case there is external interrupt pending the code generates "external
interrupt exit" and overwrites previous exit info. If previously injected
exception already generated exit it will be lost.
Signed-off-by: NGleb Natapov <gleb@redhat.com>
Acked-by: NJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 f4f51050
...@@ -1707,6 +1707,14 @@ static inline bool nested_svm_intr(struct vcpu_svm *svm) ...@@ -1707,6 +1707,14 @@ static inline bool nested_svm_intr(struct vcpu_svm *svm)
if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
return false; return false;
/*
* if vmexit was already requested (by intercepted exception
* for instance) do not overwrite it with "external interrupt"
* vmexit.
*/
if (svm->nested.exit_required)
return false;
svm->vmcb->control.exit_code = SVM_EXIT_INTR; svm->vmcb->control.exit_code = SVM_EXIT_INTR;
svm->vmcb->control.exit_info_1 = 0; svm->vmcb->control.exit_info_1 = 0;
svm->vmcb->control.exit_info_2 = 0; svm->vmcb->control.exit_info_2 = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册