From dad50b78b6a7507c460dc349acfbda78e91b3ee3 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 26 Aug 2010 00:57:51 +0200 Subject: Do not advice to install libc0.3-xen on 4gb_segment trap ext2fs.static will trigger some anyway. Instead, provide an easy way to track how many traps happen. * i386/i386/gdt.c [MACH_XEN] (gdt_init): Disable enabling VMASST_TYPE_4gb_segments_notify. * i386/i386/trap.c [MACH_XEN] (user_trap): Remove printing libc0.3-xen installation advice on 4gb_segments trap. Instead, print a count every 10000 traps, and disable them on the 1000000th. --- i386/i386/gdt.c | 2 ++ i386/i386/trap.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/i386/i386/gdt.c b/i386/i386/gdt.c index 68f5764..f26a50c 100644 --- a/i386/i386/gdt.c +++ b/i386/i386/gdt.c @@ -71,8 +71,10 @@ 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 0 if (hyp_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify)) panic("couldn't set 4gb segments vm assist notify"); +#endif #else /* MACH_XEN */ /* Load the new GDT. */ { diff --git a/i386/i386/trap.c b/i386/i386/trap.c index a0cebcb..a2e77da 100644 --- a/i386/i386/trap.c +++ b/i386/i386/trap.c @@ -530,9 +530,11 @@ printf("user trap %d error %d sub %08x\n", type, code, subcode); case 15: { static unsigned count = 0; - if (!count) { - count = 1; - printf("4gb segment access, probably from TLS use, please use a Xenified libc package (i.e. with the nosegneg option)\n"); + count++; + if (!(count % 10000)) + print("%d 4gb segments accesses\n", count); + if (count > 1000000) { + printf("A million 4gb segment accesses, stopping reporting them."); if (hyp_vm_assist(VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify)) panic("couldn't disable 4gb segments vm assist notify"); } -- cgit v1.2.3