[PR #3864] [MERGED] Kernel.Vmm: Remove hack from #2726 #3767

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

📋 Pull Request Information

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

Base: mainHead: kill-tlou2


📝 Commits (3)

  • 17f38c4 Remove SceKernelInternalMemory mapping
  • 6bacbdd Unreachable for unpatched code
  • 744e716 Update linker.cpp

📊 Changes

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

View changed files

📝 src/core/cpu_patches.cpp (+5 -4)
📝 src/core/linker.cpp (+0 -11)

📄 Description

In #2726, I mistakenly interpreted the SceKernelInternalMemory memory mapping I was seeing in some tests as a flexible memory mapping. As I've learned more about the PS4, I've learned that this mapping is treated as a system mapping, which falls under a different budget (which we don't yet emulate).

Through local tests, I've found that keeping this inaccurate behavior around will cause significant regressions when we start making library HLEs more accurate (especially pieces of the network stack), so I'm reverting this for now.

If I remember correctly, this should fix the regression seen in https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/370, though since I don't own the game, I cannot verify this.

This will regress The Last of Us™ Part II. This is not a title I plan to fix, as the inaccuracies in reported flexible memory come from behaviors that require time consuming, hacky fixes to handle properly on an emulator planning to be as high level as we are.

I've also replaced a cpu patches error for failing to patch an address with an unreachable. The error being hit would trigger an infinite loop of log spam (see reports like https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/615)


🔄 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/3864 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 12/11/2025 **Status:** ✅ Merged **Merged:** 12/11/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `kill-tlou2` --- ### 📝 Commits (3) - [`17f38c4`](https://github.com/shadps4-emu/shadPS4/commit/17f38c4defa75397fafcf8357cfddee6de5223d8) Remove SceKernelInternalMemory mapping - [`6bacbdd`](https://github.com/shadps4-emu/shadPS4/commit/6bacbdd8dee287384c0232956d819fb31c4654f8) Unreachable for unpatched code - [`744e716`](https://github.com/shadps4-emu/shadPS4/commit/744e716fce982821d28b60b82e39519997a8f436) Update linker.cpp ### 📊 Changes **2 files changed** (+5 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/core/cpu_patches.cpp` (+5 -4) 📝 `src/core/linker.cpp` (+0 -11) </details> ### 📄 Description In #2726, I mistakenly interpreted the SceKernelInternalMemory memory mapping I was seeing in some tests as a flexible memory mapping. As I've learned more about the PS4, I've learned that this mapping is treated as a system mapping, which falls under a different budget (which we don't yet emulate). Through local tests, I've found that keeping this inaccurate behavior around will cause significant regressions when we start making library HLEs more accurate (especially pieces of the network stack), so I'm reverting this for now. If I remember correctly, this should fix the regression seen in https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/370, though since I don't own the game, I cannot verify this. This will regress The Last of Us™ Part II. This is not a title I plan to fix, as the inaccuracies in reported flexible memory come from behaviors that require time consuming, hacky fixes to handle properly on an emulator planning to be as high level as we are. I've also replaced a cpu patches error for failing to patch an address with an unreachable. The error being hit would trigger an infinite loop of log spam (see reports like https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/615) --- <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:54 +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#3767
No description provided.