From: Jan Kiszka <[EMAIL PROTECTED]>

This fixes the issue booting FreeDOS under userspace kvm-70rc1 and
above.

Signed-off-by: Mohammed Gamal <[EMAIL PROTECTED]>

---
 arch/x86/kvm/vmx.c         |   12 ++++++++++++
 include/asm-x86/kvm_host.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f998943..6145dbd 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2235,6 +2235,18 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
        if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0)
                if (emulate_instruction(vcpu, NULL, 0, 0, 0) == EMULATE_DONE)
                        return 1;
+
+       /*
+        * Forward #DB to host, this is required to boot FreeDOS
+        *
+        * FIXME: Quick-hack, breaks guest debugging in real mode, will be
+        * fixed with the required debugging infrastructure rework.
+        */
+       if (vec == DB_VECTOR) {
+               vmx_inject_irq(vcpu, vec);
+               return 1;
+       }
+
        return 0;
 }

diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 82237b2..aad6244 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -56,6 +56,7 @@
 #define KVM_PAGES_PER_HPAGE (KVM_HPAGE_SIZE / PAGE_SIZE)

 #define DE_VECTOR 0
+#define DB_VECTOR 1
 #define UD_VECTOR 6
 #define NM_VECTOR 7
 #define DF_VECTOR 8
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to