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
This commit is contained in:
Roger Pau Monné 2018-01-20 14:59:37 +00:00
parent 2b541904af
commit 50a53194f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328199
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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