]> git.proxmox.com Git - mirror_edk2.git/commit
ArmVirtPkg/ArmVirtQemu: use non-accelerated CopyMem for VariableRuntimeDxe
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 14 Nov 2017 10:13:03 +0000 (10:13 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 16 Nov 2017 09:38:12 +0000 (09:38 +0000)
commit44d71c217ccbd87e8c42768b4e84b1c899d779e2
tree9ae6f7ace205589304a44b30fdec93cdc159113c
parent0d07a8addb78076a1417149786cb430396a59add
ArmVirtPkg/ArmVirtQemu: use non-accelerated CopyMem for VariableRuntimeDxe

The VariableRuntimeDxe driver may use CopyMem () on NOR flash regions,
assuming such regions always have full memory semantics. Given that
those regions cannot be mapped as ordinary memory on ARM (due to the
fact that the NOR flash requires device semantics while in write mode)
this prevents us from using BaseMemoryLibOptDxe in VariableRuntimeDxe,
since it may use unaligned accesses and/or DC ZVA instructions, both
of which are incompatible with mappings using device semantics.

Note that there is no way we can work around this by changing the
mapping type between 'memory' and 'device' when switching from read to
write mode and back, because the runtime mapping is created by the OS,
and cannot be changed at will.

So let's just switch to the unaccelerated version of BaseMemoryLib which
does not have the same problem.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Shannon Zhao <zhaoshenglong@huawei.com>
ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/ArmVirtQemuKernel.dsc