Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race between JIT executing emulated code and another image starting. #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andreiw
Copy link
Contributor

@andreiw andreiw commented May 7, 2024

More silent corruption due to lack of reentrance. But it's not enough to wrap uc_mem_protect...interrupts can be re-enabled inside JITted code (or really anytime) due to TPL manipulation, so need to hook the EFI_CPU_ARCH_PROTOCOL interrupt manipulation routines.

Very much reaching the point where a better JIT needs to be written that doesn't have the reentrancy issues.

More silent corruption due to lack of reentrance. But it's not enough
to wrap uc_mem_protect...interrupts can be re-enabled inside JITted
code (or really anytime) due to TPL manipulation, so need to hook
the EFI_CPU_ARCH_PROTOCOL interrupt manipulation routines.

Very much reaching the point where a better JIT needs to be written
that doesn't have the reentrancy issues.

Tested with ArmVirtPkg running the virtio-net x64 driver + loading
another x64 driver from Shell. No longer seeing Mnp/Snp errors
due to accessing bogus buffer address.

Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant