svn commit: r328199 - in head/sys: amd64/amd64 i386/i386
Roger Pau Monné
royger at FreeBSD.org
Sat Jan 20 14:59:38 UTC 2018
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
More information about the svn-src-head
mailing list