Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jan 2018 14:59:37 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328199 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <201801201459.w0KExbTC061170@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Sat Jan 20 14:59:37 2018
New Revision: 328199
URL: https://svnweb.freebsd.org/changeset/base/328199

Log:
  xen: fix IDT setup after PTI
  
  On amd64 the IDT handler was not set correctly when using PTI.
  
  While there also fix the selectors to SEL_KPL.
  
  Obtained from:	kib
  MFC with:	r328083

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

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Sat Jan 20 14:47:27 2018	(r328198)
+++ head/sys/amd64/amd64/machdep.c	Sat Jan 20 14:59:37 2018	(r328199)
@@ -1667,7 +1667,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 	    &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0);
 #endif
 #ifdef XENHVM
-	setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYSIGT, SEL_UPL, 0);
+	setidt(IDT_EVTCHN, pti ? &IDTVEC(xen_intr_upcall_pti) :
+	    &IDTVEC(xen_intr_upcall), SDT_SYSIGT, SEL_KPL, 0);
 #endif
 	r_idt.rd_limit = sizeof(idt0) - 1;
 	r_idt.rd_base = (long) idt;

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Sat Jan 20 14:47:27 2018	(r328198)
+++ head/sys/i386/i386/machdep.c	Sat Jan 20 14:59:37 2018	(r328199)
@@ -2268,7 +2268,7 @@ init386(int first)
 	    GSEL(GCODE_SEL, SEL_KPL));
 #endif
 #ifdef XENHVM
-	setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYS386IGT, SEL_UPL,
+	setidt(IDT_EVTCHN, &IDTVEC(xen_intr_upcall), SDT_SYS386IGT, SEL_KPL,
 	    GSEL(GCODE_SEL, SEL_KPL));
 #endif
 



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