Skip to content

Commit

Permalink
VDSOEmulation: Support loading VDSO thunk as shared
Browse files Browse the repository at this point in the history
Just requires a thread pointer check to be fixed in FEXCore.
This doesn't need unique pages to exist for the file mapping and can be
shared since it's readonly mapped.
  • Loading branch information
Sonicadvance1 committed Oct 4, 2024
1 parent b89f5b8 commit 7f67fc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions FEXCore/Source/Interface/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,8 @@ void ContextImpl::InvalidateGuestCodeRange(FEXCore::Core::InternalThreadState* T
}

void ContextImpl::MarkMemoryShared(FEXCore::Core::InternalThreadState* Thread) {
if (!Thread) return;

if (!IsMemoryShared) {
IsMemoryShared = true;
UpdateAtomicTSOEmulationConfig();
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/LinuxEmulation/VDSO_Emulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ VDSOMapping LoadVDSOThunks(bool Is64Bit, FEX::HLE::SyscallHandler* const Handler
Mapping.VDSOSize = FEXCore::AlignUp(Mapping.VDSOSize, 4096);

// Map the VDSO file to memory
Mapping.VDSOBase = Handler->GuestMmap(nullptr, nullptr, Mapping.VDSOSize, PROT_READ, MAP_PRIVATE, VDSOFD, 0);
Mapping.VDSOBase = Handler->GuestMmap(nullptr, nullptr, Mapping.VDSOSize, PROT_READ, MAP_SHARED, VDSOFD, 0);

// Since we found our VDSO thunk library, find our host VDSO function implementations.
LoadHostVDSO();
Expand Down

0 comments on commit 7f67fc9

Please sign in to comment.