summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/GoldfishRealTimeClockLib
AgeCommit message (Collapse)AuthorFilesLines
6 daysOvmfPkg: Use ReadUnaligned64 for 64-bit FDT property cellsDoug Cook1-1/+1
FDT property values are guaranteed to be 4-byte aligned. Several OvmfPkg modules read 64-bit "reg" cells by dereferencing a UINT64 pointer into the property data. That is undefined behavior, and it faults on AArch64 whenever the access is not naturally aligned and the MMU is off. This was observed on ArmVirtQemu-derived firmware as a data abort (ESR 0x96000021, DFSC alignment fault, FAR 0x4000025c) in QemuFwCfgInitialize(), which is in QemuFwCfgMmioPeiLib and runs from PEI before the MMU is enabled. Read these cells with ReadUnaligned64(), as QemuVirtMemInfoLib, FdtNorFlashQemuLib and VirtioMmioProbeLib already do. Covered: - QemuFwCfgLib (MMIO PEI and DXE): fw-cfg "reg" - RiscVVirt PlatformSecLib: "reg" of MMIO nodes - LoongArchVirt PlatformPei: RTC "reg" - GoldfishRealTimeClockLib: RTC "reg" - FdtPciHostBridgeLib, FdtPciPcdProducerLib: ECAM "reg" - VirtioFdtDxe: virtio-mmio "reg" Signed-off-by: Doug Cook <idigdoug@gmail.com>
2026-09-01OvmfPkg: Add Goldfish Rtc Lib王海梦003544753-0/+378
Add Goldfish RTC Lib to OvmfPkg. This library provides an interface for the Goldfish RTC device used in emulators such as QEMU Riscv Virt Platform, supporting time read/write functions. Signed-off-by: Haimeng Wang <wang.haimeng@zte.com.cn>