diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -910,6 +910,7 @@ char buf[24]; int revision; + feature_enable(FEATURE_EARLY_ACPI); if ((rsdp = efi_get_table(&acpi20)) == NULL) if ((rsdp = efi_get_table(&acpi)) == NULL) return; diff --git a/stand/i386/libi386/biosacpi.c b/stand/i386/libi386/biosacpi.c --- a/stand/i386/libi386/biosacpi.c +++ b/stand/i386/libi386/biosacpi.c @@ -54,6 +54,8 @@ char buf[24]; int revision; + feature_enable(FEATURE_EARLY_ACPI); + /* locate and validate the RSDP */ if ((rsdp = biosacpi_find_rsdp()) == NULL) return; diff --git a/stand/lua/core.lua b/stand/lua/core.lua --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -133,17 +133,20 @@ end function core.hasACPI() - return loader.getenv("acpi.rsdp") ~= nil -end + -- We can't trust acpi.rsdp to be set if the loader binary doesn't do + -- ACPI detection early enough. UEFI loader historically didn't, so + -- we'll fallback to assuming ACPI is enabled if this binary does not + -- declare that it probes for ACPI early enough + if loader.getenv("acpi.rsdp") ~= nil then + return true + end -function core.isX86() - return loader.machine_arch == "i386" or loader.machine_arch == "amd64" + return core.hasFeature("EARLY_ACPI") end function core.getACPI() if not core.hasACPI() then - -- x86 requires ACPI pretty much - return false or core.isX86() + return false end -- Otherwise, respect disabled if it's set