lastRuptClear = mach_absolute_time(); /* Get the time of clear */
rval = 1; /* Normal return */
+ (void) ml_set_interrupts_enabled(FALSE);
break;
}
* slot */
}
rval = 1;
+ (void) ml_set_interrupts_enabled(FALSE);
break;
case dgPowerStat:
rdmsr64_carefully(MSR_IA32_RING_PERF_STATUS, &pkes.ring_ratio_instantaneous);
pkes.IA_frequency_clipping_cause = ~0ULL;
- rdmsr64_carefully(MSR_IA32_IA_PERF_LIMIT_REASONS, &pkes.IA_frequency_clipping_cause);
+
+ uint32_t ia_perf_limits = MSR_IA32_IA_PERF_LIMIT_REASONS;
+ /* Should perhaps be a generic register map module for these
+ * registers with identical functionality that were renumbered.
+ */
+ switch (cpuid_cpufamily()) {
+ case CPUFAMILY_INTEL_SKYLAKE:
+ ia_perf_limits = MSR_IA32_IA_PERF_LIMIT_REASONS_SKL;
+ break;
+ default:
+ break;
+ }
+
+ rdmsr64_carefully(ia_perf_limits, &pkes.IA_frequency_clipping_cause);
pkes.GT_frequency_clipping_cause = ~0ULL;
rdmsr64_carefully(MSR_IA32_GT_PERF_LIMIT_REASONS, &pkes.GT_frequency_clipping_cause);
cest.cpu_urc = cpu_data_ptr[i]->cpu_cur_urc;
#if DIAG_ALL_PMCS
bcopy(&cpu_data_ptr[i]->cpu_gpmcs[0], &cest.gpmcs[0], sizeof(cest.gpmcs));
-#endif /* DIAG_ALL_PMCS */
+#endif /* DIAG_ALL_PMCS */
(void) ml_set_interrupts_enabled(TRUE);
copyout(&cest, curpos, sizeof(cest));
curpos += sizeof(cest);
}
rval = 1;
+ (void) ml_set_interrupts_enabled(FALSE);
}
break;
case dgEnaPMC:
rval = 1;
}
break;
-#if DEBUG
+#if DEVELOPMENT || DEBUG
case dgGzallocTest:
{
(void) ml_set_interrupts_enabled(TRUE);
kfree(ptr, 1024);
*ptr = 0x42;
}
+ (void) ml_set_interrupts_enabled(FALSE);
}
break;
#endif
-#if PERMIT_PERMCHECK
+#if DEVELOPMENT || DEBUG
case dgPermCheck:
{
(void) ml_set_interrupts_enabled(TRUE);
if (diagflag)
rval = pmap_permissions_verify(kernel_pmap, kernel_map, 0, ~0ULL);
+ (void) ml_set_interrupts_enabled(FALSE);
}
break;
-#endif /* PERMIT_PERMCHECK */
+#endif /* DEVELOPMENT || DEBUG */
default: /* Handle invalid ones */
rval = 0; /* Return an exception */
}
regs->rax = rval;
+ assert(ml_get_interrupts_enabled() == FALSE);
return rval;
}