summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2010-08-22 00:15:26 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-08-22 00:15:26 +0200
commit91e3fde091fb809ea9e14c5b7a752ad5270471b6 (patch)
tree050256fd13780b49284ce09a7d28db81d25b4853
parentae34e897a3dc935b2c5995b573acb254224c065c (diff)
Report Xen 4gb segment emulation
* i386/i386/gdt.c [MACH_XEN] (gdt_init): Enable VMASST_TYPE_4gb_segments_notify. * i386/i386/idt_inittab.S [MACH_XEN]: Set trap 15 as pushing an error code. * i386/i386/trap.c [MACH_XEN]: Print trap 15 first occurrence.
-rw-r--r--i386/i386/gdt.c2
-rw-r--r--i386/i386/idt_inittab.S4
-rw-r--r--i386/i386/trap.c12
3 files changed, 18 insertions, 0 deletions
diff --git a/i386/i386/gdt.c b/i386/i386/gdt.c
index b5fb033..68f5764 100644
--- a/i386/i386/gdt.c
+++ b/i386/i386/gdt.c
@@ -71,6 +71,8 @@ gdt_init()
panic("couldn't set gdt\n");
if (hyp_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments))
panic("couldn't set 4gb segments vm assist");
+ if (hyp_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify))
+ panic("couldn't set 4gb segments vm assist notify");
#else /* MACH_XEN */
/* Load the new GDT. */
{
diff --git a/i386/i386/idt_inittab.S b/i386/i386/idt_inittab.S
index 4dcad8d..63e554b 100644
--- a/i386/i386/idt_inittab.S
+++ b/i386/i386/idt_inittab.S
@@ -108,7 +108,11 @@ EXCEP_SPC(0x0b,t_segnp)
EXCEP_ERR(0x0c,t_stack_fault)
EXCEP_SPC(0x0d,t_gen_prot)
EXCEP_SPC(0x0e,t_page_fault)
+#ifdef MACH_XEN
+EXCEP_ERR(0x0f,t_trap_0f)
+#else
EXCEPTION(0x0f,t_trap_0f)
+#endif
EXCEPTION(0x10,t_fpu_err)
EXCEPTION(0x11,t_trap_11)
EXCEPTION(0x12,t_trap_12)
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 28a9e0c..1527fee 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -526,6 +526,18 @@ printf("user trap %d error %d sub %08x\n", type, code, subcode);
/*NOTREACHED*/
break;
+#ifdef MACH_XEN
+ case 15:
+ {
+ static unsigned count = 0;
+ if (!count) {
+ printf("4gb segment access, probably from TLS use, please use a Xenified libc package (i.e. with the nosegneg option)\n");
+ count = 1;
+ }
+ return 0;
+ }
+#endif
+
case T_FLOATING_POINT_ERROR:
fpexterrflt();
return 0;