summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjan Zhong <ajan.zhong@newfw.com>2024-11-19 21:45:41 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-09 02:23:28 +0000
commit694cc9f1004be90e85dd003711b4724a04e8e697 (patch)
treee679a76bc390d012ea29c219335a28c1fdf3dc07
parentddb4ea681b899e28fd8436c416e0bcdab2e362c9 (diff)
downloadedk2-694cc9f1004be90e85dd003711b4724a04e8e697.tar.gz
UefiPayloadPkg: Update ReadUnaligned64 in ACPI parsing
According to ACPI Specification, 64 bit physical address of the XSDT provides indentical functionality to the RSDT but accommodates physical address of description headers that are larger than 32 bits. In this case physical address of XSDT table is 64 bit aligned, however size of ACPI description tabled header is not 64 bit aligned. It leads to the entry of other description headers are not 64 bit aligned. In AARCH64 architecture, deference non-aligned 64 bit address to fetch 64-bit data will trigger Alignment fault. Use ReadUnaligned64 method to fix this unaligned data access issue. Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
-rw-r--r--UefiPayloadPkg/UefiPayloadEntry/AcpiTable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiPayloadPkg/UefiPayloadEntry/AcpiTable.c b/UefiPayloadPkg/UefiPayloadEntry/AcpiTable.c
index a7ee00f3e9..b50f460bb3 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/AcpiTable.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/AcpiTable.c
@@ -77,7 +77,7 @@ ParseAcpiInfo (
Entry64 = (UINT64 *)(Xsdt + 1);
Entry64Num = (Xsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) >> 3;
for (Idx = 0; Idx < Entry64Num; Idx++) {
- Signature = (UINT32 *)(UINTN)Entry64[Idx];
+ Signature = (UINT32 *)(UINTN)ReadUnaligned64 (&Entry64[Idx]);
if (*Signature == EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {
Fadt = (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)Signature;
DEBUG ((DEBUG_INFO, "Found Fadt in Xsdt\n"));