[PR #3859] [MERGED] libkernel: Implement sceKernelEnableDmemAliasing, proper mapping type checks in posix_mmap #3763

Closed
opened 2026-02-27 22:04:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3859
Author: @StevenMiller123
Created: 12/7/2025
Status: Merged
Merged: 12/8/2025
Merged by: @georgemoralis

Base: mainHead: quick-mem-fixes


📝 Commits (5)

📊 Changes

2 files changed (+43 additions, -5 deletions)

View changed files

📝 src/core/libraries/kernel/memory.cpp (+40 -5)
📝 src/core/memory.h (+3 -0)

📄 Description

This PR includes proper checks for dmem aliasing (implemented in a naive way for now), and adds three flags to Core::MemoryMapFlags for determining memory type.
For mmap, flag Anon signifies mappings with no backing (flex mem), flag Stack is for mapping stack memory, and flag Void is for reserving memory. These can all be verified through decompiling libkernel, as it uses these flags for mmap calls in the relevant kernel functions.

This PR needs regression testing, primarily in titles with SDK version at or above 2.50. I don't have access to the wider range of games I own, so I can't really test this myself.

Would also be nice to have someone test Red Dead Redemption 2, it is the only game I've seen sceKernelEnableDmemAliasing called in, but I can't test it right now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3859 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 12/7/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `quick-mem-fixes` --- ### 📝 Commits (5) - [`0acd69d`](https://github.com/shadps4-emu/shadPS4/commit/0acd69d82c0eb867c9a56be3a614632ee0451ab8) Basic handling for MAP_VOID, MAP_STACK, and MAP_ANON in mmap. - [`1bbb3a6`](https://github.com/shadps4-emu/shadPS4/commit/1bbb3a6e1c2e21a6acbf62f1a4f7b5525ab24c1a) Update memory.cpp - [`110461f`](https://github.com/shadps4-emu/shadPS4/commit/110461f0e5e5561f4c1e680817f0cc33e167825b) Update memory.cpp - [`9cdd547`](https://github.com/shadps4-emu/shadPS4/commit/9cdd547904f3d02e941965796a7201293feaf22b) Dmem aliasing check - [`ea426a8`](https://github.com/shadps4-emu/shadPS4/commit/ea426a8d39fe69a6b4ba2d99b2d88eb7f12cc6be) Oops ### 📊 Changes **2 files changed** (+43 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/memory.cpp` (+40 -5) 📝 `src/core/memory.h` (+3 -0) </details> ### 📄 Description This PR includes proper checks for dmem aliasing (implemented in a naive way for now), and adds three flags to Core::MemoryMapFlags for determining memory type. For mmap, flag Anon signifies mappings with no backing (flex mem), flag Stack is for mapping stack memory, and flag Void is for reserving memory. These can all be verified through decompiling libkernel, as it uses these flags for mmap calls in the relevant kernel functions. This PR needs regression testing, primarily in titles with SDK version at or above 2.50. I don't have access to the wider range of games I own, so I can't really test this myself. Would also be nice to have someone test Red Dead Redemption 2, it is the only game I've seen sceKernelEnableDmemAliasing called in, but I can't test it right now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:04:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3763
No description provided.