summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2015-01-25 08:16:51 +0000
committercperciva <cperciva@FreeBSD.org>2015-01-25 08:16:51 +0000
commit65e2f9460344e1eebe2ed160db1b56b96ab407fa (patch)
treef620ae08f7eb88ffa86a9435bf7330762f5dd71e /sys/dev
parentc8660cb9dbc66c7c91c172c9e108b410791d522c (diff)
downloadFreeBSD-src-65e2f9460344e1eebe2ed160db1b56b96ab407fa.zip
FreeBSD-src-65e2f9460344e1eebe2ed160db1b56b96ab407fa.tar.gz
MFC r277318:
When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't accidentally enable non-existent states. This bug was triggered if ACPI advertises the presence of a C2 state which we fail to parse via acpi_PkgGas due to our lack of support for FFixedHW resources, and causes an immediate panic when an attempt is made to enter the (NULL) state. One affected platform is the EC2 c4.8xlarge VM instance type; there may be others.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi_cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index e58d980..cfa833a 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -872,7 +872,7 @@ acpi_cpu_startup(void *arg)
for (i = 0; i < cpu_ndevices; i++) {
sc = device_get_softc(cpu_devices[i]);
if (cpu_quirks & CPU_QUIRK_NO_C3) {
- sc->cpu_cx_count = sc->cpu_non_c3 + 1;
+ sc->cpu_cx_count = min(sc->cpu_cx_count, sc->cpu_non_c3 + 1);
}
AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY,
acpi_cpu_notify, sc);
OpenPOWER on IntegriCloud