svn commit: r333522 - head/sys/i386/i386

Konstantin Belousov kib at FreeBSD.org
Sat May 12 10:48:55 UTC 2018


Author: kib
Date: Sat May 12 10:48:53 2018
New Revision: 333522
URL: https://svnweb.freebsd.org/changeset/base/333522

Log:
  Fix use of the custom TSS on i386 after the 4/4 split.
  
  Record common_tssd, the descriptor to be written in GDT to point to
  the common TSS, before LTR is executed.  The LTR instruction sets the
  loaded descriptor type to 386 TSS busy, which traps on reloads.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Sat May 12 10:11:33 2018	(r333521)
+++ head/sys/i386/i386/machdep.c	Sat May 12 10:48:53 2018	(r333522)
@@ -2532,12 +2532,12 @@ machdep_init_trampoline(void)
 	gdt[GPROC0_SEL].sd.sd_lobase = (int)tss;
 	gdt[GPROC0_SEL].sd.sd_hibase = (u_int)tss >> 24;
 	gdt[GPROC0_SEL].sd.sd_type = SDT_SYS386TSS;
-	ltr(GSEL(GPROC0_SEL, SEL_KPL));
 
 	PCPU_SET(fsgs_gdt, &gdt[GUFS_SEL].sd);
 	PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd);
 	PCPU_SET(common_tssd, *PCPU_GET(tss_gdt));
 	PCPU_SET(common_tssp, tss);
+	ltr(GSEL(GPROC0_SEL, SEL_KPL));
 
 	trampoline = pmap_trm_alloc(end_exceptions - start_exceptions,
 	    M_NOWAIT);


More information about the svn-src-all mailing list