Module Name:    src
Committed By:   cherry
Date:           Sat Aug  6 21:06:34 UTC 2011

Modified Files:
        src/sys/arch/i386/i386 [cherry-xenmp]: machdep.c

Log Message:
Update cpu local GDT entries for TLS registers %gs and %fs


To generate a diff of this commit:
cvs rdiff -u -r1.702.2.2 -r1.702.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.702.2.2 src/sys/arch/i386/i386/machdep.c:1.702.2.3
--- src/sys/arch/i386/i386/machdep.c:1.702.2.2	Sun Jul 31 20:49:10 2011
+++ src/sys/arch/i386/i386/machdep.c	Sat Aug  6 21:06:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.702.2.2 2011/07/31 20:49:10 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.702.2.3 2011/08/06 21:06:34 cherry 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.702.2.2 2011/07/31 20:49:10 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.702.2.3 2011/08/06 21:06:34 cherry Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -560,6 +560,12 @@
 
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_esp0);
 
+	/* Update TLS segment pointers */
+	update_descriptor(&ci->ci_gdt[GUFS_SEL],
+			  (union descriptor *) &pcb->pcb_fsd);
+	update_descriptor(&ci->ci_gdt[GUGS_SEL], 
+			  (union descriptor *) &pcb->pcb_gsd);
+
 	physop.cmd = PHYSDEVOP_SET_IOPL;
 	physop.u.set_iopl.iopl = pcb->pcb_iopl;
 	HYPERVISOR_physdev_op(&physop);

Reply via email to