Skip to content

Commit

Permalink
Merge pull request #4103 from Sonicadvance1/shared_vdso_mmap
Browse files Browse the repository at this point in the history
VDSOEmulation: Support loading VDSO thunk as shared
  • Loading branch information
lioncash authored Oct 10, 2024
2 parents c00f781 + c740801 commit 389ad73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions FEXCore/Source/Interface/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,10 @@ 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 389ad73

Please sign in to comment.