]> git.proxmox.com Git - mirror_edk2.git/commit
ArmVirt: don't use unaligned CopyMem () on NOR flash
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 16 Jan 2023 09:46:39 +0000 (10:46 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 16 Jan 2023 11:43:02 +0000 (11:43 +0000)
commit987cc09c7cf38d628063062483e2341fba679b0e
tree4f5b1191a2aadf5b574c46ae9fbf53199033aefb
parent47ab397011b6d1ce4d5805117dc87d9e35f378db
ArmVirt: don't use unaligned CopyMem () on NOR flash

Commit 789a72328553 reclassified the NOR flash region as EFI_MEMORY_WC
in the OS visible EFI memory map, and dropped the explicit aligned
CopyMem() implementation, in the assumption that EFI_MEMORY_WC will be
honored by the OS, and that the region will be mapped in a way that
tolerates misaligned accesseses. However, Linux today uses device
attributes for all EFI MMIO regions, in spite of the memory type
attributes, and so using misaligned accesses is never safe.

So instead, switch to the generic CopyMem() implementation entirely,
just like we already did for VariableRuntimeDxe.

Fixes: 789a72328553 ("OvmfPkg/VirtNorFlashDxe: use EFI_MEMORY_WC and drop AlignedCopyMem()")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
ArmVirtPkg/ArmVirtKvmTool.dsc
ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/ArmVirtQemuKernel.dsc