]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/pmap.c
xnu-1504.15.3.tar.gz
[apple/xnu.git] / osfmk / i386 / pmap.c
index fc2147d4b01217ffe0d8bc3ec0f9ca2b7ce2ab96..3d12ba9f23e97743307b18934caaa5320e8cb72a 100644 (file)
@@ -273,10 +273,6 @@ static vm_object_t kptobj;
 char   *pmap_phys_attributes;
 unsigned int   last_managed_page = 0;
 
-extern ppnum_t lowest_lo;
-extern ppnum_t lowest_hi;
-extern ppnum_t highest_hi;
-
 /*
  *     Amount of virtual memory mapped by one
  *     page-directory entry.
@@ -392,6 +388,8 @@ extern char end;
 
 static int nkpt;
 
+extern         long    NMIPI_acks;
+
 pt_entry_t     *DMAP1, *DMAP2;
 caddr_t         DADDR1;
 caddr_t         DADDR2;
@@ -2988,7 +2986,7 @@ pmap_cpuset_NMIPI(cpu_set cpu_mask) {
                if (cpu_mask & cpu_bit)
                        cpu_NMI_interrupt(cpu);
        }
-       deadline = mach_absolute_time() + (LockTimeOut);
+       deadline = mach_absolute_time() + (LockTimeOut * 2);
        while (mach_absolute_time() < deadline)
                cpu_pause();
 }
@@ -3057,18 +3055,7 @@ pmap_flush_tlbs(pmap_t   pmap)
                 * Wait for those other cpus to acknowledge
                 */
                while (cpus_to_respond != 0) {
-                       if (mach_absolute_time() > deadline) {
-                               if (mp_recent_debugger_activity())
-                                       continue;
-                               if (!panic_active()) {
-                                       pmap_tlb_flush_timeout = TRUE;
-                                       pmap_cpuset_NMIPI(cpus_to_respond);
-                               }
-                               panic("pmap_flush_tlbs() timeout: "
-                                   "cpu(s) failing to respond to interrupts, pmap=%p cpus_to_respond=0x%lx",
-                                   pmap, cpus_to_respond);
-                       }
-
+                       long orig_acks = 0;
                        for (cpu = 0, cpu_bit = 1; cpu < real_ncpus; cpu++, cpu_bit <<= 1) {
                                if ((cpus_to_respond & cpu_bit) != 0) {
                                        if (!cpu_datap(cpu)->cpu_running ||
@@ -3081,6 +3068,17 @@ pmap_flush_tlbs(pmap_t   pmap)
                                if (cpus_to_respond == 0)
                                        break;
                        }
+                       if (mach_absolute_time() > deadline) {
+                               if (machine_timeout_suspended())
+                                       continue;
+                               pmap_tlb_flush_timeout = TRUE;
+                               orig_acks = NMIPI_acks;
+                               pmap_cpuset_NMIPI(cpus_to_respond);
+
+                               panic("TLB invalidation IPI timeout: "
+                                   "CPU(s) failed to respond to interrupts, unresponsive CPU bitmap: 0x%lx, NMIPI acks: orig: 0x%lx, now: 0x%lx",
+                                   cpus_to_respond, orig_acks, NMIPI_acks);
+                       }
                }
        }
        /*