kernel - Refactor machdep.cpu_idle_hlt
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Apr 2018 01:06:19 +0000 (18:06 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Apr 2018 01:26:34 +0000 (18:26 -0700)
commit704d2129313f4d074fc7fb551c19703110402702
tree7cdd2d30ee55d970079c3e2f51c324b4dac6e8f4
parent93b72ee4ec68f42ca5add61ff344bebd674bdbd4
kernel - Refactor machdep.cpu_idle_hlt

* Refactor machdep.cpu_idle_hlt.  Operation works essentially the
  same way as before but the code is a lot easier to read.

* Refactor mode 3 to have ACPI call back into machdep when entering
  a C1 halt.  Continue using HLT for this situation as we aren't
  really sure what ACPI may or may not have done.  MONITOR/MWAIT
  might not be appropriate.

* Fix bug in cpu_smp_stopped().  Just because cpu_mwait_hints is
  non-zero does not mean that there is an index entry for CPU_MWAIT_C1.
  Use the last entry based on cpu_mwait_hints instead.

* Note that machdep.cpu_idle_hlt mode 2 still doesn't work as intended.
sys/dev/acpica/acpi_cpu_cstate.c
sys/platform/pc64/x86_64/machdep.c
sys/sys/systm.h