KVM: VMX: Reinject real mode exception
authorJan Kiszka <jan.kiszka@web.de>
Mon, 14 Jul 2008 10:28:51 +0000 (12:28 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 15 Oct 2008 08:15:14 +0000 (10:15 +0200)
commit77ab6db0a1c403387b403e9351ab3f5ae1df83e6
tree8f2aa6dd842afbc45f52904cc25a575a92765e98
parent19bd8afdc4e6fbb47e4841f8d771f8cb29916d9f
KVM: VMX: Reinject real mode exception

As we execute real mode guests in VM86 mode, exception have to be
reinjected appropriately when the guest triggered them. For this purpose
the patch adopts the real-mode injection pattern used in vmx_inject_irq
to vmx_queue_exception, additionally taking care that the IP is set
correctly for #BP exceptions. Furthermore it extends
handle_rmode_exception to reinject all those exceptions that can be
raised in real mode.

This fixes the execution of himem.exe from FreeDOS and also makes its
debug.com work properly.

Note that guest debugging in real mode is broken now. This has to be
fixed by the scheduled debugging infrastructure rework (will be done
once base patches for QEMU have been accepted).

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/vmx.c
include/asm-x86/kvm_host.h