Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 May 2018 10:48:54 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333522 - head/sys/i386/i386
Message-ID:  <201805121048.w4CAmsUT083648@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805121048.w4CAmsUT083648>