Module Name: src
Committed By: riz
Date: Mon Feb 27 20:29:36 UTC 2012
Modified Files:
src/sys/arch/i386/i386 [netbsd-6]: machdep.c
Log Message:
Pull up following revision(s) (requested by bouyer in ticket #60):
sys/arch/i386/i386/machdep.c: revision 1.722
Do not special-case XEN and always use the proper selectors for %fs and %gs
in buildcontext() and setregs(). The consequence was that signal handlers
would have the wrong %fs/%gs. Found by running atf tests under Xen/i386.
To generate a diff of this commit:
cvs rdiff -u -r1.717.2.2 -r1.717.2.3 src/sys/arch/i386/i386/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.717.2.2 src/sys/arch/i386/i386/machdep.c:1.717.2.3
--- src/sys/arch/i386/i386/machdep.c:1.717.2.2 Thu Feb 23 18:37:32 2012
+++ src/sys/arch/i386/i386/machdep.c Mon Feb 27 20:29:36 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.717.2.2 2012/02/23 18:37:32 riz Exp $ */
+/* $NetBSD: machdep.c,v 1.717.2.3 2012/02/27 20:29:36 riz Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717.2.2 2012/02/23 18:37:32 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717.2.3 2012/02/27 20:29:36 riz Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -734,13 +734,8 @@ buildcontext(struct lwp *l, int sel, voi
{
struct trapframe *tf = l->l_md.md_regs;
-#ifndef XEN
tf->tf_gs = GSEL(GUGS_SEL, SEL_UPL);
tf->tf_fs = GSEL(GUFS_SEL, SEL_UPL);
-#else
- tf->tf_gs = GSEL(GUDATA_SEL, SEL_UPL);
- tf->tf_fs = GSEL(GUDATA_SEL, SEL_UPL);
-#endif
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eip = (int)catcher;
@@ -1019,13 +1014,8 @@ setregs(struct lwp *l, struct exec_packa
memcpy(&pcb->pcb_gsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_gsd));
tf = l->l_md.md_regs;
-#ifndef XEN
tf->tf_gs = GSEL(GUGS_SEL, SEL_UPL);
tf->tf_fs = GSEL(GUFS_SEL, SEL_UPL);
-#else
- tf->tf_gs = LSEL(LUDATA_SEL, SEL_UPL);
- tf->tf_fs = LSEL(LUDATA_SEL, SEL_UPL);
-#endif
tf->tf_es = LSEL(LUDATA_SEL, SEL_UPL);
tf->tf_ds = LSEL(LUDATA_SEL, SEL_UPL);
tf->tf_edi = 0;