]> git.proxmox.com Git - mirror_edk2.git/commit - ArmVirtPkg/HighMemDxe/HighMemDxe.c
ArmVirtPkg: restrict mapping attributes of normal memory to EFI_MEMORY_WB
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 8 Sep 2016 07:40:09 +0000 (08:40 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 8 Sep 2016 09:35:22 +0000 (10:35 +0100)
commitf2509d6d3efbed3cf90c44ace94a331b912b0017
treec603c8274ae0441af167c45990dd15d52db83745
parent2bdf3f2ca78eae4abcaa058c0ff4f590c215dd82
ArmVirtPkg: restrict mapping attributes of normal memory to EFI_MEMORY_WB

In general, on an ARM system, mapping normal memory as device memory may
have unintended side effects, given that unaligned accesses or loads and
stores with special semantics (e.g., load/store exclusive) may fault or
may not work as expected.

Under KVM, the situation is even worse, since the host may not expect the
guest to perform uncached accesses, and so writes to such an uncached
region may get lost completely.

Since the only safe mapping type under KVM is EFI_MEMORY_WB, remove all
other memory type attributes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/HighMemDxe/HighMemDxe.c
ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c