2 * Copyright (c) 2003-2011 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 #include <sys/param.h>
31 #include <sys/kernel.h>
32 #include <sys/sysctl.h>
33 #include <i386/cpuid.h>
35 #include <i386/rtclock_protos.h>
36 #include <i386/machine_routines.h>
37 #include <i386/pal_routines.h>
38 #include <i386/ucode.h>
39 #include <kern/clock.h>
40 #include <libkern/libkern.h>
41 #include <i386/lapic.h>
46 _i386_cpu_info SYSCTL_HANDLER_ARGS
48 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
57 if (arg2
== 0 && ((char *)ptr
)[0] == '\0') {
61 if (arg2
== sizeof(uint8_t)) {
62 value
= (uint32_t) *(uint8_t *)ptr
;
64 arg2
= sizeof(uint32_t);
66 return SYSCTL_OUT(req
, ptr
, arg2
? (size_t) arg2
: strlen((char *)ptr
)+1);
70 i386_cpu_info SYSCTL_HANDLER_ARGS
72 void *ptr
= (uint8_t *)cpuid_info() + (uintptr_t)arg1
;
73 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
77 i386_cpu_info_nonzero SYSCTL_HANDLER_ARGS
79 void *ptr
= (uint8_t *)cpuid_info() + (uintptr_t)arg1
;
80 int value
= *(uint32_t *)ptr
;
85 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
88 cpu_mwait SYSCTL_HANDLER_ARGS
90 i386_cpu_info_t
*cpu_info
= cpuid_info();
91 void *ptr
= (uint8_t *)cpu_info
->cpuid_mwait_leafp
+ (uintptr_t)arg1
;
92 if (cpu_info
->cpuid_mwait_leafp
== NULL
)
94 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
98 cpu_thermal SYSCTL_HANDLER_ARGS
100 i386_cpu_info_t
*cpu_info
= cpuid_info();
101 void *ptr
= (uint8_t *)cpu_info
->cpuid_thermal_leafp
+ (uintptr_t)arg1
;
102 if (cpu_info
->cpuid_thermal_leafp
== NULL
)
104 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
108 cpu_arch_perf SYSCTL_HANDLER_ARGS
110 i386_cpu_info_t
*cpu_info
= cpuid_info();
111 void *ptr
= (uint8_t *)cpu_info
->cpuid_arch_perf_leafp
+ (uintptr_t)arg1
;
112 if (cpu_info
->cpuid_arch_perf_leafp
== NULL
)
114 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
118 cpu_xsave SYSCTL_HANDLER_ARGS
120 i386_cpu_info_t
*cpu_info
= cpuid_info();
121 void *ptr
= (uint8_t *)cpu_info
->cpuid_xsave_leafp
+ (uintptr_t)arg1
;
122 if (cpu_info
->cpuid_xsave_leafp
== NULL
)
124 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
129 cpu_features SYSCTL_HANDLER_ARGS
131 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
132 __unused
void *unused_arg1
= arg1
;
133 __unused
int unused_arg2
= arg2
;
137 cpuid_get_feature_names(cpuid_features(), buf
, sizeof(buf
));
139 return SYSCTL_OUT(req
, buf
, strlen(buf
) + 1);
143 cpu_extfeatures SYSCTL_HANDLER_ARGS
145 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
146 __unused
void *unused_arg1
= arg1
;
147 __unused
int unused_arg2
= arg2
;
151 cpuid_get_extfeature_names(cpuid_extfeatures(), buf
, sizeof(buf
));
153 return SYSCTL_OUT(req
, buf
, strlen(buf
) + 1);
157 cpu_leaf7_features SYSCTL_HANDLER_ARGS
159 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
160 __unused
void *unused_arg1
= arg1
;
161 __unused
int unused_arg2
= arg2
;
164 uint32_t leaf7_features
= cpuid_info()->cpuid_leaf7_features
;
165 if (leaf7_features
== 0)
169 cpuid_get_leaf7_feature_names(leaf7_features
, buf
, sizeof(buf
));
171 return SYSCTL_OUT(req
, buf
, strlen(buf
) + 1);
175 cpu_logical_per_package SYSCTL_HANDLER_ARGS
177 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
178 __unused
void *unused_arg1
= arg1
;
179 __unused
int unused_arg2
= arg2
;
180 i386_cpu_info_t
*cpu_info
= cpuid_info();
182 if (!(cpuid_features() & CPUID_FEATURE_HTT
))
185 return SYSCTL_OUT(req
, &cpu_info
->cpuid_logical_per_package
,
186 sizeof(cpu_info
->cpuid_logical_per_package
));
190 cpu_flex_ratio_desired SYSCTL_HANDLER_ARGS
192 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
193 __unused
void *unused_arg1
= arg1
;
194 __unused
int unused_arg2
= arg2
;
195 i386_cpu_info_t
*cpu_info
= cpuid_info();
197 if (cpu_info
->cpuid_model
!= 26)
200 return SYSCTL_OUT(req
, &flex_ratio
, sizeof(flex_ratio
));
204 cpu_flex_ratio_min SYSCTL_HANDLER_ARGS
206 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
207 __unused
void *unused_arg1
= arg1
;
208 __unused
int unused_arg2
= arg2
;
209 i386_cpu_info_t
*cpu_info
= cpuid_info();
211 if (cpu_info
->cpuid_model
!= 26)
214 return SYSCTL_OUT(req
, &flex_ratio_min
, sizeof(flex_ratio_min
));
218 cpu_flex_ratio_max SYSCTL_HANDLER_ARGS
220 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
221 __unused
void *unused_arg1
= arg1
;
222 __unused
int unused_arg2
= arg2
;
223 i386_cpu_info_t
*cpu_info
= cpuid_info();
225 if (cpu_info
->cpuid_model
!= 26)
228 return SYSCTL_OUT(req
, &flex_ratio_max
, sizeof(flex_ratio_max
));
232 cpu_ucode_update SYSCTL_HANDLER_ARGS
234 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
235 __unused
void *unused_arg1
= arg1
;
236 __unused
int unused_arg2
= arg2
;
240 error
= SYSCTL_IN(req
, &addr
, sizeof(addr
));
244 int ret
= ucode_interface(addr
);
248 extern uint64_t panic_restart_timeout
;
250 panic_set_restart_timeout(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
252 int new_value
= 0, old_value
= 0, changed
= 0, error
;
255 if (panic_restart_timeout
) {
256 absolutetime_to_nanoseconds(panic_restart_timeout
, &nstime
);
257 old_value
= nstime
/ NSEC_PER_SEC
;
260 error
= sysctl_io_number(req
, old_value
, sizeof(int), &new_value
, &changed
);
261 if (error
== 0 && changed
) {
262 nanoseconds_to_absolutetime(((uint64_t)new_value
) * NSEC_PER_SEC
, &panic_restart_timeout
);
268 * Populates the {CPU, vector, latency} triple for the maximum observed primary
272 misc_interrupt_latency_max(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
274 int changed
= 0, error
;
278 interrupt_populate_latency_stats(buf
, sizeof(buf
));
280 error
= sysctl_io_string(req
, buf
, sizeof(buf
), 0, &changed
);
282 if (error
== 0 && changed
) {
283 interrupt_reset_latency_stats();
289 #if DEVELOPMENT || DEBUG
291 * Triggers a machine-check exception - for a suitably configured kernel only.
293 extern void mca_exception_panic(void);
295 misc_machine_check_panic(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
297 int changed
= 0, error
;
301 error
= sysctl_io_string(req
, buf
, sizeof(buf
), 0, &changed
);
303 if (error
== 0 && changed
) {
304 mca_exception_panic();
310 * Triggers a non-responsive processor timeout panic - for a suitably configured kernel only.
312 static uint64_t kernel_timeout_spin
= 0;
314 misc_kernel_timeout_spin(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
318 int changed
= 0, error
;
322 absolutetime_to_nanoseconds(kernel_timeout_spin
, &old_value
);
324 error
= sysctl_io_number(req
, old_value
, sizeof(uint64_t), &new_value
, &changed
);
325 if (error
== 0 && changed
) {
326 nanoseconds_to_absolutetime(((uint64_t)new_value
), &kernel_timeout_spin
);
327 kernel_spin(kernel_timeout_spin
);
331 #endif /* DEVELOPMENT || DEBUG */
334 SYSCTL_NODE(_machdep
, OID_AUTO
, cpu
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
337 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, max_basic
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
338 (void *)offsetof(i386_cpu_info_t
, cpuid_max_basic
),sizeof(uint32_t),
339 i386_cpu_info
, "IU", "Max Basic Information value");
341 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, max_ext
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
342 (void *)offsetof(i386_cpu_info_t
, cpuid_max_ext
), sizeof(uint32_t),
343 i386_cpu_info
, "IU", "Max Extended Function Information value");
345 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, vendor
, CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
346 (void *)offsetof(i386_cpu_info_t
, cpuid_vendor
), 0,
347 i386_cpu_info
, "A", "CPU vendor");
349 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, brand_string
, CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
350 (void *)offsetof(i386_cpu_info_t
, cpuid_brand_string
), 0,
351 i386_cpu_info
, "A", "CPU brand string");
353 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, family
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
354 (void *)offsetof(i386_cpu_info_t
, cpuid_family
), sizeof(uint8_t),
355 i386_cpu_info
, "I", "CPU family");
357 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, model
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
358 (void *)offsetof(i386_cpu_info_t
, cpuid_model
), sizeof(uint8_t),
359 i386_cpu_info
, "I", "CPU model");
361 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extmodel
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
362 (void *)offsetof(i386_cpu_info_t
, cpuid_extmodel
), sizeof(uint8_t),
363 i386_cpu_info
, "I", "CPU extended model");
365 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extfamily
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
366 (void *)offsetof(i386_cpu_info_t
, cpuid_extfamily
), sizeof(uint8_t),
367 i386_cpu_info
, "I", "CPU extended family");
369 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, stepping
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
370 (void *)offsetof(i386_cpu_info_t
, cpuid_stepping
), sizeof(uint8_t),
371 i386_cpu_info
, "I", "CPU stepping");
373 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, feature_bits
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
374 (void *)offsetof(i386_cpu_info_t
, cpuid_features
), sizeof(uint64_t),
375 i386_cpu_info
, "IU", "CPU features");
377 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, leaf7_feature_bits
,
378 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
379 (void *)offsetof(i386_cpu_info_t
, cpuid_leaf7_features
),
381 i386_cpu_info_nonzero
, "IU", "CPU Leaf7 features");
383 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extfeature_bits
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
384 (void *)offsetof(i386_cpu_info_t
, cpuid_extfeatures
), sizeof(uint64_t),
385 i386_cpu_info
, "IU", "CPU extended features");
387 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, signature
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
388 (void *)offsetof(i386_cpu_info_t
, cpuid_signature
), sizeof(uint32_t),
389 i386_cpu_info
, "I", "CPU signature");
391 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, brand
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
392 (void *)offsetof(i386_cpu_info_t
, cpuid_brand
), sizeof(uint8_t),
393 i386_cpu_info
, "I", "CPU brand");
395 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, features
, CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
397 cpu_features
, "A", "CPU feature names");
399 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, leaf7_features
,
400 CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
402 cpu_leaf7_features
, "A", "CPU Leaf7 feature names");
404 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extfeatures
, CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
406 cpu_extfeatures
, "A", "CPU extended feature names");
408 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, logical_per_package
,
409 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
411 cpu_logical_per_package
, "I", "CPU logical cpus per package");
413 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, cores_per_package
,
414 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
415 (void *)offsetof(i386_cpu_info_t
, cpuid_cores_per_package
),
417 i386_cpu_info
, "I", "CPU cores per package");
419 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, microcode_version
,
420 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
421 (void *)offsetof(i386_cpu_info_t
, cpuid_microcode_version
),
423 i386_cpu_info
, "I", "Microcode version number");
425 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, processor_flag
,
426 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
427 (void *)offsetof(i386_cpu_info_t
, cpuid_processor_flag
),
429 i386_cpu_info
, "I", "CPU processor flag");
432 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, mwait
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
435 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, linesize_min
,
436 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
437 (void *)offsetof(cpuid_mwait_leaf_t
, linesize_min
),
439 cpu_mwait
, "I", "Monitor/mwait minimum line size");
441 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, linesize_max
,
442 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
443 (void *)offsetof(cpuid_mwait_leaf_t
, linesize_max
),
445 cpu_mwait
, "I", "Monitor/mwait maximum line size");
447 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, extensions
,
448 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
449 (void *)offsetof(cpuid_mwait_leaf_t
, extensions
),
451 cpu_mwait
, "I", "Monitor/mwait extensions");
453 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, sub_Cstates
,
454 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
455 (void *)offsetof(cpuid_mwait_leaf_t
, sub_Cstates
),
457 cpu_mwait
, "I", "Monitor/mwait sub C-states");
460 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, thermal
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
463 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, sensor
,
464 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
465 (void *)offsetof(cpuid_thermal_leaf_t
, sensor
),
467 cpu_thermal
, "I", "Thermal sensor present");
469 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, dynamic_acceleration
,
470 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
471 (void *)offsetof(cpuid_thermal_leaf_t
, dynamic_acceleration
),
473 cpu_thermal
, "I", "Dynamic Acceleration Technology (Turbo Mode)");
475 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, invariant_APIC_timer
,
476 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
477 (void *)offsetof(cpuid_thermal_leaf_t
, invariant_APIC_timer
),
479 cpu_thermal
, "I", "Invariant APIC Timer");
481 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, thresholds
,
482 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
483 (void *)offsetof(cpuid_thermal_leaf_t
, thresholds
),
485 cpu_thermal
, "I", "Number of interrupt thresholds");
487 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, ACNT_MCNT
,
488 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
489 (void *)offsetof(cpuid_thermal_leaf_t
, ACNT_MCNT
),
491 cpu_thermal
, "I", "ACNT_MCNT capability");
493 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, core_power_limits
,
494 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
495 (void *)offsetof(cpuid_thermal_leaf_t
, core_power_limits
),
497 cpu_thermal
, "I", "Power Limit Notifications at a Core Level");
499 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, fine_grain_clock_mod
,
500 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
501 (void *)offsetof(cpuid_thermal_leaf_t
, fine_grain_clock_mod
),
503 cpu_thermal
, "I", "Fine Grain Clock Modulation");
505 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, package_thermal_intr
,
506 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
507 (void *)offsetof(cpuid_thermal_leaf_t
, package_thermal_intr
),
509 cpu_thermal
, "I", "Package Thermal interrupt and Status");
511 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, hardware_feedback
,
512 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
513 (void *)offsetof(cpuid_thermal_leaf_t
, hardware_feedback
),
515 cpu_thermal
, "I", "Hardware Coordination Feedback");
517 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, energy_policy
,
518 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
519 (void *)offsetof(cpuid_thermal_leaf_t
, energy_policy
),
521 cpu_thermal
, "I", "Energy Efficient Policy Support");
523 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, xsave
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
526 SYSCTL_PROC(_machdep_cpu_xsave
, OID_AUTO
, extended_state
,
527 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
529 sizeof(cpuid_xsave_leaf_t
),
530 cpu_xsave
, "IU", "XSAVE Extended State Main Leaf");
532 SYSCTL_PROC(_machdep_cpu_xsave
, OID_AUTO
, extended_state1
,
533 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
534 (void *) sizeof(cpuid_xsave_leaf_t
),
535 sizeof(cpuid_xsave_leaf_t
),
536 cpu_xsave
, "IU", "XSAVE Extended State Sub-leaf 1");
539 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, arch_perf
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
542 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, version
,
543 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
544 (void *)offsetof(cpuid_arch_perf_leaf_t
, version
),
546 cpu_arch_perf
, "I", "Architectural Performance Version Number");
548 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, number
,
549 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
550 (void *)offsetof(cpuid_arch_perf_leaf_t
, number
),
552 cpu_arch_perf
, "I", "Number of counters per logical cpu");
554 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, width
,
555 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
556 (void *)offsetof(cpuid_arch_perf_leaf_t
, width
),
558 cpu_arch_perf
, "I", "Bit width of counters");
560 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, events_number
,
561 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
562 (void *)offsetof(cpuid_arch_perf_leaf_t
, events_number
),
564 cpu_arch_perf
, "I", "Number of monitoring events");
566 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, events
,
567 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
568 (void *)offsetof(cpuid_arch_perf_leaf_t
, events
),
570 cpu_arch_perf
, "I", "Bit vector of events");
572 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, fixed_number
,
573 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
574 (void *)offsetof(cpuid_arch_perf_leaf_t
, fixed_number
),
576 cpu_arch_perf
, "I", "Number of fixed-function counters");
578 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, fixed_width
,
579 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
580 (void *)offsetof(cpuid_arch_perf_leaf_t
, fixed_width
),
582 cpu_arch_perf
, "I", "Bit-width of fixed-function counters");
585 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, cache
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
588 SYSCTL_PROC(_machdep_cpu_cache
, OID_AUTO
, linesize
,
589 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
590 (void *)offsetof(i386_cpu_info_t
, cpuid_cache_linesize
),
592 i386_cpu_info
, "I", "Cacheline size");
594 SYSCTL_PROC(_machdep_cpu_cache
, OID_AUTO
, L2_associativity
,
595 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
596 (void *)offsetof(i386_cpu_info_t
, cpuid_cache_L2_associativity
),
598 i386_cpu_info
, "I", "L2 cache associativity");
600 SYSCTL_PROC(_machdep_cpu_cache
, OID_AUTO
, size
,
601 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
602 (void *)offsetof(i386_cpu_info_t
, cpuid_cache_size
),
604 i386_cpu_info
, "I", "Cache size (in Kbytes)");
607 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, tlb
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
609 SYSCTL_NODE(_machdep_cpu_tlb
, OID_AUTO
, inst
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
611 SYSCTL_NODE(_machdep_cpu_tlb
, OID_AUTO
, data
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
614 SYSCTL_PROC(_machdep_cpu_tlb_inst
, OID_AUTO
, small
,
615 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
616 (void *)offsetof(i386_cpu_info_t
,
617 cpuid_tlb
[TLB_INST
][TLB_SMALL
][0]),
619 i386_cpu_info_nonzero
, "I",
620 "Number of small page instruction TLBs");
622 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, small
,
623 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
624 (void *)offsetof(i386_cpu_info_t
,
625 cpuid_tlb
[TLB_DATA
][TLB_SMALL
][0]),
627 i386_cpu_info_nonzero
, "I",
628 "Number of small page data TLBs (1st level)");
630 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, small_level1
,
631 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
632 (void *)offsetof(i386_cpu_info_t
,
633 cpuid_tlb
[TLB_DATA
][TLB_SMALL
][1]),
635 i386_cpu_info_nonzero
, "I",
636 "Number of small page data TLBs (2nd level)");
638 SYSCTL_PROC(_machdep_cpu_tlb_inst
, OID_AUTO
, large
,
639 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
640 (void *)offsetof(i386_cpu_info_t
,
641 cpuid_tlb
[TLB_INST
][TLB_LARGE
][0]),
643 i386_cpu_info_nonzero
, "I",
644 "Number of large page instruction TLBs");
646 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, large
,
647 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
648 (void *)offsetof(i386_cpu_info_t
,
649 cpuid_tlb
[TLB_DATA
][TLB_LARGE
][0]),
651 i386_cpu_info_nonzero
, "I",
652 "Number of large page data TLBs (1st level)");
654 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, large_level1
,
655 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
656 (void *)offsetof(i386_cpu_info_t
,
657 cpuid_tlb
[TLB_DATA
][TLB_LARGE
][1]),
659 i386_cpu_info_nonzero
, "I",
660 "Number of large page data TLBs (2nd level)");
662 SYSCTL_PROC(_machdep_cpu_tlb
, OID_AUTO
, shared
,
663 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
664 (void *)offsetof(i386_cpu_info_t
, cpuid_stlb
),
666 i386_cpu_info_nonzero
, "I",
667 "Number of shared TLBs");
670 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, address_bits
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
673 SYSCTL_PROC(_machdep_cpu_address_bits
, OID_AUTO
, physical
,
674 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
675 (void *)offsetof(i386_cpu_info_t
, cpuid_address_bits_physical
),
677 i386_cpu_info
, "I", "Number of physical address bits");
679 SYSCTL_PROC(_machdep_cpu_address_bits
, OID_AUTO
, virtual,
680 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
681 (void *)offsetof(i386_cpu_info_t
, cpuid_address_bits_virtual
),
683 i386_cpu_info
, "I", "Number of virtual address bits");
686 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, core_count
,
687 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
688 (void *)offsetof(i386_cpu_info_t
, core_count
),
690 i386_cpu_info
, "I", "Number of enabled cores per package");
692 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, thread_count
,
693 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
694 (void *)offsetof(i386_cpu_info_t
, thread_count
),
696 i386_cpu_info
, "I", "Number of enabled threads per package");
698 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, flex_ratio
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
701 SYSCTL_PROC(_machdep_cpu_flex_ratio
, OID_AUTO
, desired
,
702 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
704 cpu_flex_ratio_desired
, "I", "Flex ratio desired (0 disabled)");
706 SYSCTL_PROC(_machdep_cpu_flex_ratio
, OID_AUTO
, min
,
707 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
709 cpu_flex_ratio_min
, "I", "Flex ratio min (efficiency)");
711 SYSCTL_PROC(_machdep_cpu_flex_ratio
, OID_AUTO
, max
,
712 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
714 cpu_flex_ratio_max
, "I", "Flex ratio max (non-turbo)");
716 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, ucupdate
,
717 CTLTYPE_INT
| CTLFLAG_WR
| CTLFLAG_LOCKED
, 0, 0,
718 cpu_ucode_update
, "S", "Microcode update interface");
720 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, tsc_ccc
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
721 "TSC/CCC frequency information");
723 SYSCTL_PROC(_machdep_cpu_tsc_ccc
, OID_AUTO
, numerator
,
724 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
725 (void *)offsetof(i386_cpu_info_t
, cpuid_tsc_leaf
.numerator
),
727 i386_cpu_info
, "I", "Numerator of TSC/CCC ratio");
729 SYSCTL_PROC(_machdep_cpu_tsc_ccc
, OID_AUTO
, denominator
,
730 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
731 (void *)offsetof(i386_cpu_info_t
, cpuid_tsc_leaf
.denominator
),
733 i386_cpu_info
, "I", "Denominator of TSC/CCC ratio");
735 static const uint32_t apic_timer_vector
= (LAPIC_DEFAULT_INTERRUPT_BASE
+ LAPIC_TIMER_INTERRUPT
);
736 static const uint32_t apic_IPI_vector
= (LAPIC_DEFAULT_INTERRUPT_BASE
+ LAPIC_INTERPROCESSOR_INTERRUPT
);
738 SYSCTL_NODE(_machdep
, OID_AUTO
, vectors
, CTLFLAG_RD
| CTLFLAG_LOCKED
, 0,
739 "Interrupt vector assignments");
741 SYSCTL_UINT (_machdep_vectors
, OID_AUTO
, timer
, CTLFLAG_RD
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, __DECONST(uint32_t *,&apic_timer_vector
), 0, "");
742 SYSCTL_UINT (_machdep_vectors
, OID_AUTO
, IPI
, CTLFLAG_RD
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, __DECONST(uint32_t *,&apic_IPI_vector
), 0, "");
744 uint64_t pmap_pv_hashlist_walks
;
745 uint64_t pmap_pv_hashlist_cnts
;
746 uint32_t pmap_pv_hashlist_max
;
747 uint32_t pmap_kernel_text_ps
= PAGE_SIZE
;
748 extern uint32_t pv_hashed_kern_low_water_mark
;
750 /*extern struct sysctl_oid_list sysctl__machdep_pmap_children;*/
752 SYSCTL_NODE(_machdep
, OID_AUTO
, pmap
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
755 SYSCTL_QUAD (_machdep_pmap
, OID_AUTO
, hashwalks
, CTLFLAG_RD
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, &pmap_pv_hashlist_walks
, "");
756 SYSCTL_QUAD (_machdep_pmap
, OID_AUTO
, hashcnts
, CTLFLAG_RD
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, &pmap_pv_hashlist_cnts
, "");
757 SYSCTL_INT (_machdep_pmap
, OID_AUTO
, hashmax
, CTLFLAG_RD
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, &pmap_pv_hashlist_max
, 0, "");
758 SYSCTL_INT (_machdep_pmap
, OID_AUTO
, kernel_text_ps
, CTLFLAG_RD
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, &pmap_kernel_text_ps
, 0, "");
759 SYSCTL_INT (_machdep_pmap
, OID_AUTO
, kern_pv_reserve
, CTLFLAG_RW
| CTLFLAG_KERN
| CTLFLAG_LOCKED
, &pv_hashed_kern_low_water_mark
, 0, "");
761 SYSCTL_NODE(_machdep
, OID_AUTO
, memmap
, CTLFLAG_RD
|CTLFLAG_LOCKED
, NULL
, "physical memory map");
763 uint64_t firmware_Conventional_bytes
= 0;
764 uint64_t firmware_RuntimeServices_bytes
= 0;
765 uint64_t firmware_ACPIReclaim_bytes
= 0;
766 uint64_t firmware_ACPINVS_bytes
= 0;
767 uint64_t firmware_PalCode_bytes
= 0;
768 uint64_t firmware_Reserved_bytes
= 0;
769 uint64_t firmware_Unusable_bytes
= 0;
770 uint64_t firmware_other_bytes
= 0;
772 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Conventional
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_Conventional_bytes
, "");
773 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, RuntimeServices
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_RuntimeServices_bytes
, "");
774 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, ACPIReclaim
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_ACPIReclaim_bytes
, "");
775 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, ACPINVS
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_ACPINVS_bytes
, "");
776 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, PalCode
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_PalCode_bytes
, "");
777 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Reserved
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_Reserved_bytes
, "");
778 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Unusable
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_Unusable_bytes
, "");
779 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Other
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_other_bytes
, "");
781 SYSCTL_NODE(_machdep
, OID_AUTO
, tsc
, CTLFLAG_RD
|CTLFLAG_LOCKED
, NULL
, "Timestamp counter parameters");
783 SYSCTL_QUAD(_machdep_tsc
, OID_AUTO
, frequency
,
784 CTLFLAG_RD
|CTLFLAG_LOCKED
, &tscFreq
, "");
786 extern uint32_t deep_idle_rebase
;
787 SYSCTL_UINT(_machdep_tsc
, OID_AUTO
, deep_idle_rebase
,
788 CTLFLAG_RD
|CTLFLAG_LOCKED
, &deep_idle_rebase
, 0, "");
789 SYSCTL_QUAD(_machdep_tsc
, OID_AUTO
, at_boot
,
790 CTLFLAG_RD
|CTLFLAG_LOCKED
, &tsc_at_boot
, "");
791 SYSCTL_QUAD(_machdep_tsc
, OID_AUTO
, rebase_abs_time
,
792 CTLFLAG_RD
|CTLFLAG_LOCKED
, &tsc_rebase_abs_time
, "");
794 SYSCTL_NODE(_machdep_tsc
, OID_AUTO
, nanotime
,
795 CTLFLAG_RD
|CTLFLAG_LOCKED
, NULL
, "TSC to ns conversion");
796 SYSCTL_QUAD(_machdep_tsc_nanotime
, OID_AUTO
, tsc_base
,
797 CTLFLAG_RD
| CTLFLAG_LOCKED
,
798 __DECONST(uint64_t *, &pal_rtc_nanotime_info
.tsc_base
), "");
799 SYSCTL_QUAD(_machdep_tsc_nanotime
, OID_AUTO
, ns_base
,
800 CTLFLAG_RD
| CTLFLAG_LOCKED
,
801 __DECONST(uint64_t *, &pal_rtc_nanotime_info
.ns_base
), "");
802 SYSCTL_UINT(_machdep_tsc_nanotime
, OID_AUTO
, scale
,
803 CTLFLAG_RD
| CTLFLAG_LOCKED
,
804 __DECONST(uint32_t *, &pal_rtc_nanotime_info
.scale
), 0, "");
805 SYSCTL_UINT(_machdep_tsc_nanotime
, OID_AUTO
, shift
,
806 CTLFLAG_RD
| CTLFLAG_LOCKED
,
807 __DECONST(uint32_t *, &pal_rtc_nanotime_info
.shift
), 0, "");
808 SYSCTL_UINT(_machdep_tsc_nanotime
, OID_AUTO
, generation
,
809 CTLFLAG_RD
| CTLFLAG_LOCKED
,
810 __DECONST(uint32_t *, &pal_rtc_nanotime_info
.generation
), 0, "");
812 SYSCTL_NODE(_machdep
, OID_AUTO
, misc
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
813 "Miscellaneous x86 kernel parameters");
815 #if (DEVELOPMENT || DEBUG)
816 extern uint32_t mp_interrupt_watchdog_events
;
817 SYSCTL_UINT(_machdep_misc
, OID_AUTO
, interrupt_watchdog_events
,
818 CTLFLAG_RW
|CTLFLAG_LOCKED
, &mp_interrupt_watchdog_events
, 0, "");
822 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, panic_restart_timeout
,
823 CTLTYPE_INT
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
825 panic_set_restart_timeout
, "I", "Panic restart timeout in seconds");
827 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, interrupt_latency_max
,
828 CTLTYPE_STRING
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
830 misc_interrupt_latency_max
, "A", "Maximum Interrupt latency");
832 #if DEVELOPMENT || DEBUG
833 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, machine_check_panic
,
834 CTLTYPE_STRING
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
836 misc_machine_check_panic
, "A", "Machine-check exception test");
838 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, kernel_timeout_spin
,
839 CTLTYPE_QUAD
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
840 0, sizeof(kernel_timeout_spin
),
841 misc_kernel_timeout_spin
, "Q", "Kernel timeout panic test");
843 SYSCTL_QUAD(_machdep
, OID_AUTO
, reportphyreadabs
,
844 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
845 &reportphyreaddelayabs
, "");
846 SYSCTL_INT(_machdep
, OID_AUTO
, reportphyreadosbt
,
847 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
848 &reportphyreadosbt
, 0, "");
849 SYSCTL_INT(_machdep
, OID_AUTO
, phyreaddelaypanic
,
850 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
851 &phyreadpanic
, 0, "");
853 extern int pmap_pagezero_mitigation
;
854 extern int pmap_asserts_enabled
, pmap_asserts_traced
;
855 /* On DEV/DEBUG kernels, clear this to disable the SMAP emulation
856 * (address space disconnect) for pagezero-less processes.
858 SYSCTL_INT(_machdep
, OID_AUTO
, pmap_pagezero_mitigation
,
859 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
860 &pmap_pagezero_mitigation
, 0, "");
861 /* Toggle pmap assertions */
862 SYSCTL_INT(_machdep
, OID_AUTO
, pmap_asserts
,
863 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
864 &pmap_asserts_enabled
, 0, "");
865 /* Transform pmap assertions into kernel trace terminations */
866 SYSCTL_INT(_machdep
, OID_AUTO
, pmap_asserts_traced
,
867 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
868 &pmap_asserts_traced
, 0, "");
871 misc_svisor_read(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
873 uint64_t new_value
= 0, old_value
= 0;
874 int changed
= 0, error
;
876 error
= sysctl_io_number(req
, old_value
, sizeof(uint64_t), &new_value
, &changed
);
877 if ((error
== 0) && changed
) {
878 volatile uint32_t *raddr
= (uint32_t *) new_value
;
879 printf("Supervisor: value at 0x%llx is 0x%x\n", new_value
, *raddr
);
884 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, misc_svisor_read
,
885 CTLTYPE_QUAD
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
887 misc_svisor_read
, "I", "supervisor mode read");
889 #endif /* DEVELOPMENT || DEBUG */
891 extern void timer_queue_trace_cpu(int);
893 misc_timer_queue_trace(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
895 int changed
= 0, error
;
899 error
= sysctl_io_string(req
, buf
, sizeof(buf
), 0, &changed
);
901 if (error
== 0 && changed
) {
902 timer_queue_trace_cpu(0);
907 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, timer_queue_trace
,
908 CTLTYPE_STRING
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
910 misc_timer_queue_trace
, "A", "Cut timer queue tracepoint");
912 extern long NMI_count
;
913 extern void NMI_cpus(void);
915 misc_nmis(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
917 int new = 0, old
= 0, changed
= 0, error
;
921 error
= sysctl_io_number(req
, old
, sizeof(int), &new, &changed
);
922 if (error
== 0 && changed
) {
929 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, nmis
,
930 CTLTYPE_INT
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
932 misc_nmis
, "I", "Report/increment NMI count");
934 /* Parameters related to timer coalescing tuning, to be replaced
935 * with a dedicated systemcall in the future.
937 /* Enable processing pending timers in the context of any other interrupt */
938 SYSCTL_INT(_kern
, OID_AUTO
, interrupt_timer_coalescing_enabled
,
939 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
940 &interrupt_timer_coalescing_enabled
, 0, "");
941 /* Upon entering idle, process pending timers with HW deadlines
942 * this far in the future.
944 SYSCTL_INT(_kern
, OID_AUTO
, timer_coalesce_idle_entry_hard_deadline_max
,
945 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
946 &idle_entry_timer_processing_hdeadline_threshold
, 0, "");
948 /* Track potentially expensive eager timer evaluations on QoS tier
951 extern uint32_t ml_timer_eager_evaluations
;
953 SYSCTL_INT(_machdep
, OID_AUTO
, eager_timer_evaluations
,
954 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
955 &ml_timer_eager_evaluations
, 0, "");
957 extern uint64_t ml_timer_eager_evaluation_max
;
959 SYSCTL_QUAD(_machdep
, OID_AUTO
, eager_timer_evaluation_max
,
960 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
961 &ml_timer_eager_evaluation_max
, "");
962 extern uint64_t x86_isr_fp_simd_use
;
963 SYSCTL_QUAD(_machdep
, OID_AUTO
, x86_fp_simd_isr_uses
,
964 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
965 &x86_isr_fp_simd_use
, "");
966 #if DEVELOPMENT || DEBUG
968 extern int plctrace_enabled
;
970 SYSCTL_INT(_machdep
, OID_AUTO
, pltrace
,
971 CTLFLAG_KERN
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
972 &plctrace_enabled
, 0, "");
973 #endif /* DEVELOPMENT || DEBUG */