On Tue, 08 Sep 2015 13:33:52 +0900 (JST)
YASUOKA Masahiko <[email protected]> wrote:
>>Synopsis: acpi attach fail "ACPI control unavailable"
>>Category: system
>>Environment:
> System : OpenBSD 5.8
> Details : OpenBSD 5.8-current (GENERIC.MP) #1362: Mon Sep 7
> 07:00:12 MDT 2015
>
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>
> Architecture: OpenBSD.amd64
> Machine : amd64
>>Description:
> Boot OpenBSD on VMware guest (vm version 8) on VMware ESXi 5.5
> with efiboot, attaching acpi(4) failed with the message "ACPI
> control unavailable".
>
> - vmx0 also failed to attach with the message "failed to map
> interrupt".
> - ESXi is running on DELL PowerEdge R420.
> - This doesn't happen if OpenBSD boot with BIOS boot.
>>How-To-Repeat:
> Repeat always at least on the environment written in "Description"
>>Fix:
> Applying the diff following fixes the problem. SMI_CMD is not
> available when HW_REDUCED_ACPI flag is set (section 4.1 in ACPI
> 6.0 spec)
The diff was confusing. HW_REDUCED_ACPI is not related and actually
it is not set on the VMware.
ACPI 6.0 spec says in section 5.2.9, acpi_enable == 0 or acpi_disable
== 0 means the legacy mode is not supported.
Index: dev/acpi/acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.294
diff -u -p -r1.294 acpi.c
--- dev/acpi/acpi.c 6 Sep 2015 16:47:48 -0000 1.294
+++ dev/acpi/acpi.c 8 Sep 2015 05:20:49 -0000
@@ -910,12 +910,11 @@ acpi_attach(struct device *parent, struc
}
/*
- * Check if we are able to enable ACPI control
+ * Check if legacy mode is supported
*/
- if (sc->sc_fadt->smi_cmd &&
+ if (sc->sc_fadt->smi_cmd &&
(!sc->sc_fadt->acpi_enable && !sc->sc_fadt->acpi_disable)) {
- printf(", ACPI control unavailable\n");
- return;
+ printf(", no legacy mode");
}
/*
@@ -1501,6 +1500,10 @@ int
acpi_enable(struct acpi_softc *sc)
{
int idx;
+
+ /* legacy mode is not supported */
+ if (sc->sc_fadt->acpi_enable == 0 && sc->sc_fadt->acpi_disable == 0)
+ return 0;
acpi_write_pmreg(sc, ACPIREG_SMICMD, 0, sc->sc_fadt->acpi_enable);
idx = 0;