[PR #3775] [MERGED] Windows: Limit address space maximum when higher addresses are not needed #3714

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

📋 Pull Request Information

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

Base: mainHead: limit-address


📝 Commits (10+)

  • cad8adf Earlier initialization of elf info.
  • a15fb24 Extract compiled SDK version from pubtoolinfo string
  • 80fa245 Store compiled SDK version in ElfInfo
  • 0492a75 Limit address space for compiled SDK version at or above FW 3
  • c9b092e Use compiled SDK version for sceKernelGetCompiledSdkVersion
  • a5cb0c5 Log SDK version
  • d31e01a Update address_space.cpp
  • 8e24459 Update emulator.cpp
  • 414cc0d Merge branch 'shadps4-emu:main' into limit-address
  • a911341 Backwards compatible logging

📊 Changes

4 files changed (+66 additions, -25 deletions)

View changed files

📝 src/common/elf_info.h (+6 -0)
📝 src/core/address_space.cpp (+17 -8)
📝 src/core/libraries/kernel/process.cpp (+1 -1)
📝 src/emulator.cpp (+42 -16)

📄 Description

While decompiling the PS4 kernel, I've found that every form of memory mapping restricts the maximum address to 0xfc00000000, but only if the compiled SDK version is at or above firmware 3.00.

Since the expanded address space causes performance issues on Windows specifically, this PR restricts the address space maximum to 0x10000000000 when running newer games that would have this address restriction applied.

To enable this change, I've also addressed some issues with game loading logic. Specifically, I've added logic for getting the actual compiled SDK version from the param.sfo, as opposed to the game's required firmware version. I also shifted ElfInfo initialization earlier in our code, since we're already loading the param.sfo earlier to accomodate separated logs.

This PR is primarily to address the severe Windows-specific loading time regression in Cyberpunk 2077 (see report https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/33#issuecomment-3483378217 for details), and similar performance regressions visible in my homebrew tests. I plan to properly implement the kernel-side address checks in a future PR.

This PR needs regression tests, particularly from EA titles that abuse high address mappings.


🔄 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/3775 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 11/6/2025 **Status:** ✅ Merged **Merged:** 11/10/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `limit-address` --- ### 📝 Commits (10+) - [`cad8adf`](https://github.com/shadps4-emu/shadPS4/commit/cad8adf33350e7cedd02bacdfd2380a964b15288) Earlier initialization of elf info. - [`a15fb24`](https://github.com/shadps4-emu/shadPS4/commit/a15fb2499e03c93663f11065c372b8eea38fb507) Extract compiled SDK version from pubtoolinfo string - [`80fa245`](https://github.com/shadps4-emu/shadPS4/commit/80fa245c1dc95c0d3baba848249787fe7448c719) Store compiled SDK version in ElfInfo - [`0492a75`](https://github.com/shadps4-emu/shadPS4/commit/0492a7593b1462a1cabfd6e10967e8a95263f625) Limit address space for compiled SDK version at or above FW 3 - [`c9b092e`](https://github.com/shadps4-emu/shadPS4/commit/c9b092ede434c06baf4805383f32bc2a2c6fd5ce) Use compiled SDK version for sceKernelGetCompiledSdkVersion - [`a5cb0c5`](https://github.com/shadps4-emu/shadPS4/commit/a5cb0c5168f1114d8a17abc6295c48c4a9687f64) Log SDK version - [`d31e01a`](https://github.com/shadps4-emu/shadPS4/commit/d31e01abd49f189fdacd5f6affa7380ded65f6d4) Update address_space.cpp - [`8e24459`](https://github.com/shadps4-emu/shadPS4/commit/8e244592f5d48e62c47a50405f318752c2f341ef) Update emulator.cpp - [`414cc0d`](https://github.com/shadps4-emu/shadPS4/commit/414cc0d2ae9905bb9b60d5ac2bc8ecfa46322b72) Merge branch 'shadps4-emu:main' into limit-address - [`a911341`](https://github.com/shadps4-emu/shadPS4/commit/a911341ff5552027c1c357993b46653c60f00a66) Backwards compatible logging ### 📊 Changes **4 files changed** (+66 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `src/common/elf_info.h` (+6 -0) 📝 `src/core/address_space.cpp` (+17 -8) 📝 `src/core/libraries/kernel/process.cpp` (+1 -1) 📝 `src/emulator.cpp` (+42 -16) </details> ### 📄 Description While decompiling the PS4 kernel, I've found that every form of memory mapping restricts the maximum address to `0xfc00000000`, but only if the compiled SDK version is at or above firmware 3.00. Since the expanded address space causes performance issues on Windows specifically, this PR restricts the address space maximum to `0x10000000000` when running newer games that would have this address restriction applied. To enable this change, I've also addressed some issues with game loading logic. Specifically, I've added logic for getting the actual compiled SDK version from the param.sfo, as opposed to the game's required firmware version. I also shifted ElfInfo initialization earlier in our code, since we're already loading the param.sfo earlier to accomodate separated logs. This PR is primarily to address the severe Windows-specific loading time regression in Cyberpunk 2077 (see report https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/33#issuecomment-3483378217 for details), and similar performance regressions visible in my homebrew tests. I plan to properly implement the kernel-side address checks in a future PR. This PR needs regression tests, particularly from EA titles that abuse high address mappings. --- <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:43 +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#3714
No description provided.