coreboot/src/acpi
Jonathan Zhang d5d9b280de acpi/acpi.c: Fix einj generation pointer arithmetics
Without a cast the aritmetics of

tat = einj + sizeof(acpi_einj_smi_t)

is the same as

tat = (uintptr_t)einj + size(acpi_einj_smi_t) * size(acpi_einj_smi_t)

So it overshoots the intended offset by a lot.

This issue only came apparent because now einj is in the small IMD
region which is close to TSEG. With the wrong aritmetics the tat
pointer ended up inside TSEG which is not accessible from the OS
causing exceptions.

TEST: observe that tat pointer is inside the small IMD below
TSEG (0x78000000 on our setup).
"acpi_create_einj trigger_action_table = 0x77ffe89c"

Change-Id: I3ab64b95c33eef01b2048816a21e17855bcb2f54
Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
Signed-off-by: Jonathan Zhang <jonzhang@meta.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69326
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
2022-11-11 00:36:40 +00:00
..
acpi.c acpi/acpi.c: Fix einj generation pointer arithmetics 2022-11-11 00:36:40 +00:00
acpi_pm.c
acpigen.c acpigen: export acpigen_write_field_name 2022-11-02 21:03:40 +00:00
acpigen_dptf.c Revert "drivers/intel/dptf: Add multiple fan support under dptf" 2022-10-20 14:54:09 +00:00
acpigen_dsm.c
acpigen_extern.asl
acpigen_pci.c
acpigen_ps2_keybd.c
acpigen_usb.c
device.c
dsdt_top.asl
gnvs.c
Kconfig
Makefile.inc
pld.c
sata.c
soundwire.c