Commits
Jan Dakinevich authored and Konstantin Khorenko committed 24af5f2bfde
ms/KVM: x86: set ctxt->have_exception in x86_decode_insn() x86_emulate_instruction() takes into account ctxt->have_exception flag during instruction decoding, but in practice this flag is never set in x86_decode_insn(). Fixes: 6ea6e84309ca ("KVM: x86: inject exceptions produced by x86_decode_insn") Cc: stable@vger.kernel.org Cc: Denis Lunev <den@virtuozzo.com> Cc: Roman Kagan <rkagan@virtuozzo.com> Cc: Denis Plotnikov <dplotnikov@virtuozzo.com> Signed-off-by: Jan Dakinevich <jan.dakinevich@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> https://jira.sw.ru/browse/PSBM-68018 (cherry-picked from c8848cee74ff05638e913582a476bde879c968ad) ===================== Patchset description: fix emulation error on Windows bootup This series intended to fix (again) a bug that was a subject of the following change: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") Suddenly, that fix had a couple mistakes. First, ctxt->have_exception was not set if fault happened during instruction decoding. Second, returning value of inject_emulated_instruction was used to make the decision to reenter guest, but this could happen iff on nested page fault, that is not the scope where this bug could occur. https://lkml.org/lkml/2019/8/29/152 Jan Dakinevich (2): KVM: x86: always stop emulation on page fault KVM: x86: set ctxt->have_exception in x86_decode_insn() Paolo Bonzini (1): KVM: x86: inject exceptions produced by x86_decode_insn