Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2018 11:33:21 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328468 - head/sys/x86/x86
Message-ID:  <201801271133.w0RBXLqs037450@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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;



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