Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Do not special-case XEN and always use th...



details:   https://anonhg.NetBSD.org/src/rev/5f3ff6473916
branches:  trunk
changeset: 777648:5f3ff6473916
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Feb 27 19:52:59 2012 +0000

description:
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.

diffstat:

 sys/arch/i386/i386/machdep.c |  14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diffs (46 lines):

diff -r cffb65409283 -r 5f3ff6473916 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Mon Feb 27 17:56:14 2012 +0000
+++ b/sys/arch/i386/i386/machdep.c      Mon Feb 27 19:52:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.721 2012/02/24 08:06:07 cherry Exp $     */
+/*     $NetBSD: machdep.c,v 1.722 2012/02/27 19:52:59 bouyer 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.721 2012/02/24 08:06:07 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.722 2012/02/27 19:52:59 bouyer Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -723,13 +723,8 @@
 {
        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;
@@ -970,13 +965,8 @@
        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;



Home | Main Index | Thread Index | Old Index