audk/OvmfPkg/VirtNorFlashDxe
Ard Biesheuvel 789a723285 OvmfPkg/VirtNorFlashDxe: use EFI_MEMORY_WC and drop AlignedCopyMem()
NOR flash emulation under KVM involves switching between two modes,
where array mode is backed by a read-only memslot, and programming mode
is fully emulated, i.e., the memory region is not backed by anything,
and the faulting accesses are forwarded to the VMM by the hypervisor,
which translates them into NOR flash programming commands.

Normally, we are limited to the use of device attributes when mapping
such regions, given that the programming mode has MMIO semantics.
However, when running under KVM, the chosen memory attributes only take
effect when in array mode, since no memory mapping exists otherwise.

This means we can tune the memory mapping so it behaves a bit more like
a ROM, by switching to EFI_MEMORY_WC attributes. This means we no longer
need a special CopyMem() implementation that avoids unaligned accesses
at all cost.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2022-10-27 16:52:01 +00:00
..
VirtNorFlash.c OvmfPkg/VirtNorFlashDxe: use EFI_MEMORY_WC and drop AlignedCopyMem() 2022-10-27 16:52:01 +00:00
VirtNorFlash.h OvmfPkg/VirtNorFlashDxe: drop block I/O protocol implementation 2022-10-27 16:52:01 +00:00
VirtNorFlashDxe.c OvmfPkg/VirtNorFlashDxe: use EFI_MEMORY_WC and drop AlignedCopyMem() 2022-10-27 16:52:01 +00:00
VirtNorFlashDxe.inf OvmfPkg/VirtNorFlashDxe: drop block I/O protocol implementation 2022-10-27 16:52:01 +00:00
VirtNorFlashFvb.c OvmfPkg/VirtNorFlashDxe: drop block I/O protocol implementation 2022-10-27 16:52:01 +00:00