Blob Blame History Raw
changeset:   15239:656b8175f4f2
user:        kfraser@localhost.localdomain
date:        Fri Jun 08 11:19:55 2007 +0100
files:       tools/firmware/vmxassist/vm86.c tools/firmware/vmxassist/vm86.h xen/arch/x86/hvm/vmx/vmx.c xen/arch/x86/hvm/vpic.c xen/include/asm-x86/hvm/vmx/vmcs.h xen/include/public/hvm/vmx_assist.h
description:
hvm: Respect irqbase set by protected mode in mode switching with VMXAssist.

RHEL4U4 PAE SMP guest currently crashes, and we found changeset 15214
introduced it. This patch fixes it.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>


diff -r 345ae2e61ba0 -r 656b8175f4f2 tools/firmware/vmxassist/vm86.c
--- a/tools/firmware/vmxassist/vm86.c	Thu Jun 07 20:02:27 2007 +0100
+++ b/tools/firmware/vmxassist/vm86.c	Fri Jun 08 11:19:55 2007 +0100
@@ -927,6 +927,7 @@ load_or_clear_seg(unsigned long sel, uin
 		load_seg(0, base, limit, arbytes);
 }
 
+static unsigned char rm_irqbase[2];
 
 /*
  * Transition to protected mode
@@ -935,6 +936,9 @@ protected_mode(struct regs *regs)
 protected_mode(struct regs *regs)
 {
 	extern char stack_top[];
+
+	oldctx.rm_irqbase[0] = rm_irqbase[0];
+	oldctx.rm_irqbase[1] = rm_irqbase[1];
 
 	regs->eflags &= ~(EFLAGS_TF|EFLAGS_VM);
 
@@ -1187,6 +1191,7 @@ outbyte(struct regs *regs, unsigned pref
 			icw2[0] = 0;
 			printf("Remapping master: ICW2 0x%x -> 0x%x\n",
 				al, NR_EXCEPTION_HANDLER);
+			rm_irqbase[0] = al;
 			al = NR_EXCEPTION_HANDLER;
 		}
 		break;
@@ -1200,6 +1205,7 @@ outbyte(struct regs *regs, unsigned pref
 			icw2[1] = 0;
 			printf("Remapping slave: ICW2 0x%x -> 0x%x\n",
 				al, NR_EXCEPTION_HANDLER+8);
+			rm_irqbase[1] = al;
 			al = NR_EXCEPTION_HANDLER+8;
 		}
 		break;
diff -r 345ae2e61ba0 -r 656b8175f4f2 tools/firmware/vmxassist/vm86.h
--- a/tools/firmware/vmxassist/vm86.h	Thu Jun 07 20:02:27 2007 +0100
+++ b/tools/firmware/vmxassist/vm86.h	Fri Jun 08 11:19:55 2007 +0100
@@ -25,10 +25,6 @@
 #endif
 
 #include <xen/hvm/vmx_assist.h>
-
-#define	NR_EXCEPTION_HANDLER	32
-#define	NR_INTERRUPT_HANDLERS	16
-#define	NR_TRAPS		(NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
 
 #ifndef __ASSEMBLY__
 
diff -r 345ae2e61ba0 -r 656b8175f4f2 xen/include/public/hvm/vmx_assist.h
--- a/xen/include/public/hvm/vmx_assist.h	Thu Jun 07 20:02:27 2007 +0100
+++ b/xen/include/public/hvm/vmx_assist.h	Fri Jun 08 11:19:55 2007 +0100
@@ -34,6 +34,10 @@
 #define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
 
 #ifndef __ASSEMBLY__
+
+#define NR_EXCEPTION_HANDLER    32
+#define NR_INTERRUPT_HANDLERS   16
+#define NR_TRAPS        (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
 
 union vmcs_arbytes {
     struct arbyte_fields {
@@ -98,6 +102,8 @@ struct vmx_assist_context {
     uint32_t  ldtr_limit;
     uint32_t  ldtr_base;
     union vmcs_arbytes ldtr_arbytes;
+
+    unsigned char rm_irqbase[2];
 };
 typedef struct vmx_assist_context vmx_assist_context_t;