[PR #3464] [MERGED] Replace direct usage of wrgsbase and rdgsbase with a more portable solution #3490

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3464
Author: @kalaposfos13
Created: 8/27/2025
Status: Merged
Merged: 8/27/2025
Merged by: @squidbus

Base: mainHead: wrgsbase-rdgsbase


📝 Commits (2)

  • 764ec5b Replace direct usage of wrgsbase and rdgsbase with a more portable solution
  • 8f9eb46 The loathsome clang-formatter

📊 Changes

1 file changed (+10 additions, -4 deletions)

View changed files

📝 src/core/tls.cpp (+10 -4)

📄 Description

From what I found online (https://www.kernel.org/doc/html/next/x86/x86_64/fsgs.html), using these syscalls are the intended way to access these instructions on Linux. However, the syscall also supports setups where this instruction is missing or is unsupported by the kernel, namely, PS4 Linux in my case (and with this, the only modification required for the emulator to run there is recompiling with an older march that's supported by the console). From testing by me and bread, this also doesn't come with any noticeable performance drop either.


🔄 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/3464 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 8/27/2025 **Status:** ✅ Merged **Merged:** 8/27/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `wrgsbase-rdgsbase` --- ### 📝 Commits (2) - [`764ec5b`](https://github.com/shadps4-emu/shadPS4/commit/764ec5bdcf8044e47d6805dcea0dc22650c943b5) Replace direct usage of wrgsbase and rdgsbase with a more portable solution - [`8f9eb46`](https://github.com/shadps4-emu/shadPS4/commit/8f9eb4681fb7d915b010d9f296dd4d0766e99842) The loathsome clang-formatter ### 📊 Changes **1 file changed** (+10 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/core/tls.cpp` (+10 -4) </details> ### 📄 Description From what I found online (https://www.kernel.org/doc/html/next/x86/x86_64/fsgs.html), using these syscalls are the intended way to access these instructions on Linux. However, the syscall also supports setups where this instruction is missing or is unsupported by the kernel, namely, PS4 Linux in my case (and with this, the only modification required for the emulator to run there is recompiling with an older march that's supported by the console). From testing by me and bread, this also doesn't come with any noticeable performance drop either. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03: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#3490
No description provided.