]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/EbcDxe: use EfiBootServicesCode memory for thunks
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sun, 26 Feb 2017 16:45:24 +0000 (16:45 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 28 Feb 2017 14:59:50 +0000 (14:59 +0000)
commit16dc5b68fcb5ad509e2af1595aa17dcd5534819d
tree14f6093655b42e687e66f7812d5511440abbe845
parenta0ffd7a9ee575615ad5fd0777825b5362a16b49f
MdeModulePkg/EbcDxe: use EfiBootServicesCode memory for thunks

The EBC driver emits thunks for native to EBC calls, which are short
instructions sequences that bridge the gap between the native execution
environment and the EBC virtual machine.

Since these thunks are allocated using MemoryAllocationLib::AllocatePool(),
they are emitted into EfiBootServicesData regions, which does not reflect
the nature of these thunks accurately, and interferes with strict memory
protection policies that map data regions non-executable.

So instead, create a new helper EbcAllocatePoolForThunk() that invokes the
AllocatePool() boot service directly to allocate EfiBootServicesCode pool
memory explicitly, and wire up this helper for the various architecture
specific thunk generation routines.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Universal/EbcDxe/AArch64/EbcSupport.c
MdeModulePkg/Universal/EbcDxe/EbcInt.c
MdeModulePkg/Universal/EbcDxe/EbcInt.h
MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c
MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c
MdeModulePkg/Universal/EbcDxe/X64/EbcSupport.c