OvmfPkg: Use ReadUnaligned64 for 64-bit FDT property cells

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>
8 files changed