ACPI LAI on aarch64
Posted: Wed Nov 02, 2022 1:08 am
I am using LAI (https://github.com/managarm/lai) to add ACPI support to my "OS". This works wonderfully under x86_64. Now under aarch64, it appears to work except it is making unexpected calls to laihost_outb() and laihost_inw() which have no mapping in the ARMv8 world.
The firmware is ovmf-aarch64 (UEFI). and I am using "qemu-system-aarch64 -machine virt".
Here is the relevant part of the log:
This seems to be happening because of the following code in lai_enable_acpi():
I believe this code is not necessary on aarch64? The ACPI spec mentions that FADT::SMI_CMD must be zero on system that do not support System Management mode. If I comment out all of the above (and the check for the existence of laihost_inw / laihost_outb), things appear to work correctly.
I can look into submitting a pull request, but was wondering if I am missing something here.
The firmware is ovmf-aarch64 (UEFI). and I am using "qemu-system-aarch64 -machine virt".
Here is the relevant part of the log:
Code: Select all
Debug : [ACPI] attempt to enable ACPI...
Error : [ACPI] laihost_outb() not implemented: 0, 0
Error : [ACPI] laihost_sleep() not implemented (10 ms)
Error : [ACPI] laihost_inw() not implemented: 0
Debug : [ACPI] wrote event register value 0x8300
Debug : [ACPI] ACPI is now enabled.
Code: Select all
/* enable ACPI SCI */
laihost_outb(instance->fadt->smi_command_port, instance->fadt->acpi_enable);
laihost_sleep(10);
for (size_t i = 0; i < 100; i++) {
if (laihost_inw(instance->fadt->pm1a_control_block) & ACPI_ENABLED)
break;
laihost_sleep(10);
}
I can look into submitting a pull request, but was wondering if I am missing something here.