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 acpi/acpi_pm.c: refactor acpi_pm_state_for_* functions 2022-09-27 14:19:01 +00:00
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 acpi/acpigen.h: Add more intuitive AML package closing functions 2021-03-22 11:21:55 +00:00
acpigen_extern.asl ChromeOS: Refactor ACPI CNVS generation 2021-12-23 21:18:25 +00:00
acpigen_pci.c acpi: Add acpigen_write_PRT* helpers for generating _PRT entries 2021-03-24 16:08:57 +00:00
acpigen_ps2_keybd.c arch/x86/acpi: Add code for KEY_MENU 2022-02-18 20:18:41 +00:00
acpigen_usb.c ec/google/chromeec: Add retimer handle to Type C conn 2022-05-04 13:15:30 +00:00
device.c src/acpi/device: Early return in _ON if device already enabled 2022-04-14 22:30:05 +00:00
dsdt_top.asl treewide: Unify Google branding 2022-07-04 14:02:26 +00:00
gnvs.c lib/hardwaremain.c: Move creating ACPI structs to bootstate hooks 2022-04-27 10:56:47 +00:00
Kconfig ACPI: Refactor use of global and device NVS 2021-06-14 19:45:56 +00:00
Makefile.inc vc/google/chromeos: Refactor GNVS init 2021-04-30 06:46:07 +00:00
pld.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
sata.c src/acpi: Remove unused <acpi/acpi.h> 2022-01-10 17:22:47 +00:00
soundwire.c src: Remove unused <stdbool> 2022-01-19 15:15:50 +00:00