MdeModulePkg/DxeCapsuleLibFmp: clone ESRT for runtime access
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 20 Apr 2019 10:34:54 +0000 (12:34 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 23 Apr 2019 16:15:00 +0000 (18:15 +0200)
commit2c0d39ac4704b76b7efb67b0aee23c2e78045cbc
treeadad51bf3ed89cb0e0440041ac12ad41dd99ae3c
parent40ffb6dc635d0848e6a1ed48b0819d2e5d177069
MdeModulePkg/DxeCapsuleLibFmp: clone ESRT for runtime access

The DxeCapsuleLibFmp code accesses the ESRT table to decide whether
a certain capsule is an FMP capsule. Since the UEFI spec mandates
that the ESRT resides in EfiBootServicesData memory, this results
in problems at OS runtime, since the firmware implementation itself
cannot access memory that has not been virtually remapped.

So let's take a private copy of the ESRT at ReadyToBoot, and store
it in EfiRuntimeServicesData memory. The ESRT's size is order 10s
of bytes so the memory footprint is going to be negligigble.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleRuntime.c
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf