svn commit: r328468 - head/sys/x86/x86
Konstantin Belousov
kib at FreeBSD.org
Sat Jan 27 11:33:22 UTC 2018
Author: kib
Date: Sat Jan 27 11:33:21 2018
New Revision: 328468
URL: https://svnweb.freebsd.org/changeset/base/328468
Log:
Fix native_lapic_ipi_alloc().
When PTI is enabled, empty IDT slots point to rsvd_pti.
Reported by: Dexuan-BSD Cui <dexuan.bsd at gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 5 days
Modified:
head/sys/x86/x86/local_apic.c
Modified: head/sys/x86/x86/local_apic.c
==============================================================================
--- head/sys/x86/x86/local_apic.c Sat Jan 27 11:19:41 2018 (r328467)
+++ head/sys/x86/x86/local_apic.c Sat Jan 27 11:33:21 2018 (r328468)
@@ -2117,7 +2117,8 @@ native_lapic_ipi_alloc(inthand_t *ipifunc)
for (idx = IPI_DYN_FIRST; idx <= IPI_DYN_LAST; idx++) {
ip = &idt[idx];
func = (ip->gd_hioffset << 16) | ip->gd_looffset;
- if (func == (uintptr_t)&IDTVEC(rsvd)) {
+ if ((!pti && func == (uintptr_t)&IDTVEC(rsvd)) ||
+ (pti && func == (uintptr_t)&IDTVEC(rsvd_pti))) {
vector = idx;
setidt(vector, ipifunc, SDT_APIC, SEL_KPL, GSEL_APIC);
break;
More information about the svn-src-all
mailing list