[PR #3639] [MERGED] Core: physical backing for flexible and pooled memory allocations #3629

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3639
Author: @StevenMiller123
Created: 9/21/2025
Status: Merged
Merged: 9/23/2025
Merged by: @georgemoralis

Base: mainHead: flex-mem-backing


📝 Commits (10+)

📊 Changes

6 files changed (+179 additions, -44 deletions)

View changed files

📝 src/core/address_space.cpp (+3 -3)
📝 src/core/libraries/kernel/memory.cpp (+1 -1)
📝 src/core/libraries/kernel/memory.h (+19 -16)
📝 src/core/linker.cpp (+2 -2)
📝 src/core/memory.cpp (+113 -21)
📝 src/core/memory.h (+41 -1)

📄 Description

This PR handles partial unmaps of flexible memory. I've created a separate flexible memory map used to track flexible "physical" allocations, calculate free physical addresses to map, and implemented logic in MapMemory and UnmapBytesFromEntry for properly updating this flexible map.

I also added a fix for the isDevKit logic, the backing size wasn't properly updated for the increased direct memory size of isDevKit, which could cause weird issues with direct memory allocations that use the extra space.

This improves Uncharted 4: A Thief’s End™ (CUSA00341), The Last of Us™ Part II (CUSA07820), and FINAL FANTASY XV (CUSA01633) on Windows devices.


🔄 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/3639 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 9/21/2025 **Status:** ✅ Merged **Merged:** 9/23/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `flex-mem-backing` --- ### 📝 Commits (10+) - [`adccc11`](https://github.com/shadps4-emu/shadPS4/commit/adccc11074e19790737f07df599a0e938523d689) Fix isDevKit - [`12ce66f`](https://github.com/shadps4-emu/shadPS4/commit/12ce66fa4781a6a6ee55e7608bb18d3df2b6bd4b) Physical backing for flexible allocations - [`d97454b`](https://github.com/shadps4-emu/shadPS4/commit/d97454b7c77ba4a70a0411be593455cb090c3aa6) Various fixups - [`81d0737`](https://github.com/shadps4-emu/shadPS4/commit/81d0737fd1cc8b1f74dc4a6bbd26da1be587f3cc) Fix mistake #1 - [`871af75`](https://github.com/shadps4-emu/shadPS4/commit/871af75cdeff400087f2b74ecc897d5aa6e86af8) Assert + clang - [`be63ff2`](https://github.com/shadps4-emu/shadPS4/commit/be63ff2e4b8e773d91255a1c4e33fa52cf9a1811) Fix 2 - [`a1c134a`](https://github.com/shadps4-emu/shadPS4/commit/a1c134aabe079f49fde04863cde2a1ad3f833dd7) Clang - [`09c4f8d`](https://github.com/shadps4-emu/shadPS4/commit/09c4f8d3d2bce787b51d4d0c7f03c6efb7971d03) Fix CanMergeWith - [`0769de1`](https://github.com/shadps4-emu/shadPS4/commit/0769de16f9725ec33122eae0dfd224630b8e2f10) Clang - [`c7b9cdb`](https://github.com/shadps4-emu/shadPS4/commit/c7b9cdbc74f1a276e17f131996085994b98915aa) Physical backing for pooled memory ### 📊 Changes **6 files changed** (+179 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `src/core/address_space.cpp` (+3 -3) 📝 `src/core/libraries/kernel/memory.cpp` (+1 -1) 📝 `src/core/libraries/kernel/memory.h` (+19 -16) 📝 `src/core/linker.cpp` (+2 -2) 📝 `src/core/memory.cpp` (+113 -21) 📝 `src/core/memory.h` (+41 -1) </details> ### 📄 Description This PR handles partial unmaps of flexible memory. I've created a separate flexible memory map used to track flexible "physical" allocations, calculate free physical addresses to map, and implemented logic in MapMemory and UnmapBytesFromEntry for properly updating this flexible map. I also added a fix for the isDevKit logic, the backing size wasn't properly updated for the increased direct memory size of isDevKit, which could cause weird issues with direct memory allocations that use the extra space. This improves Uncharted 4: A Thief’s End™ (CUSA00341), The Last of Us™ Part II (CUSA07820), and FINAL FANTASY XV (CUSA01633) on Windows devices. --- <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:24 +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#3629
No description provided.