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....@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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to