Commit graph

723 commits

Author SHA1 Message Date
elad335
047f71b434 PPU/cellSpurs: MGS4: Fix cellSpursAddUrgentCommand race condition
cellSpursAddUrgentCommand searches in 4 slots for an empty slot to put the command at.
At first, it seems to do so unordered.

Meanwhile, on SPU side, it expects an order between all the commands because it pops them it in FIFO manner.
Not keeping track of how many commands are queued in total.

After second observation of cellSpursAddUrgentCommand, something odd comes takes places here.
Usually, reservation loops are individual and are expected to be closed without any changes of the previous loop affected by the proceeding one.
But in this case, after a single failure, the entire operayion is reset, a loop of 4 reservation operations suddenly is reset completely.

This makes one wonder if it the HW expects sometjing else here, perhaps it caches the reservation internally here?
After some adjustments to LDARX and STDCX to cache the reservation between succeeding loops, Metal Gear Solid 4 no longer freezes!
2025-03-28 19:56:54 +03:00
trigger
af23df842d
PPU: Report encrypted modules with KLIC in main file, opportunistic compilation at exit-spawn (#16743) 2025-03-01 11:45:03 +02:00
Elad
207ee59acd PPU Analyzer: Firmware/import caller analysis and KLIC finding pass 2025-02-27 12:32:21 +02:00
RipleyTom
cd87a64621 Headers cleanup 2025-02-11 20:38:35 +01:00
Elad
86b7078464 PPU LLVM: Fix compilation of PRX with no relocations 2025-02-07 20:27:17 +02:00
kd-11
6123838a48 ppu/arm64: Fix ppu_recompiler_fallback implementation for ARM processors 2025-02-02 22:44:42 +03:00
Megamouse
3187dc816e Fix some warnings 2025-02-02 17:06:39 +01:00
Elad
665bb83297
Fix Savestates recent regression 2025-01-28 18:49:19 +02:00
Elad
7fc0f69e48 PPU LLVM: Fix HLE patches 2025-01-28 12:51:52 +02:00
Megamouse
67703b49d8 Update LLVM to 18.1.8 2025-01-25 18:15:13 +01:00
Megamouse
ad6eba1670 Fix some warnings 2025-01-25 17:06:35 +01:00
Elad
5ef442c2b8 Disable ARM trampolines 2025-01-25 12:47:44 +02:00
Elad
4c0832e6e6 PPU LLVM: Reduce size of JIT-transition treampolines to 16 2025-01-25 12:47:44 +02:00
Elad
3f4210437d JIT.h: Add option for lowered function size 2025-01-25 12:47:44 +02:00
Elad
81d0dd686b LLVM: Add explicit resource-freeing at emulation stop 2025-01-25 12:47:44 +02:00
Elad
a24e747e16 PPU LLVM: Disable an experimental limit 2025-01-25 12:47:44 +02:00
Elad
05f52246a2 PPU LLVM: Simplify module progress
Do not mix module compilation with linking.
2025-01-25 12:47:44 +02:00
Elad
857eac3d10 PPU Analyzer: Remove ppu_function::name to lower sizeof(ppu_function) 2025-01-25 12:47:44 +02:00
Elad
9d5b75bb7a LLVM: Slice PPU executable memory 2025-01-25 12:47:44 +02:00
Elad
c6f3737c2a PPU LLVM: Fixup patches enlisting in analyzer 2025-01-07 20:42:45 +02:00
Elad
0b784ff2c1 PPU LLVM: Function table dependent resolver hashing 2025-01-07 15:43:41 +02:00
Elad
575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
Elad
b4505600c7 PPU: Notify SPUs while waiting for its own state 2024-11-30 18:06:34 +02:00
Elad
a4ea71d18f CELL: Rewrite reservation notification postponing 2024-11-30 18:06:34 +02:00
Elad
68d74bc28a Progress Dialog: Fix recursion and concurrency use of text updates 2024-11-16 12:22:23 +02:00
Megamouse
7866dc2e34 overlays: localize RPCS3 progress dialog 2024-11-15 09:48:12 +01:00
kd-11
be0ef0cc28 macos - Fix crash executing resolver 2024-08-24 14:13:14 +03:00
kd-11
c2f5de1c55 Fix compiler warnings about unused args for aarch64 2024-08-20 05:18:53 +03:00
Elad Ashkenazi
46ceeed10d Debugger/PPU: Minor bugfix in CR register dump 2024-08-15 14:05:25 +03:00
Elad Ashkenazi
d0ebba6c5e CELL: New reservation notifications mechanism 2024-08-14 11:53:00 +03:00
kd-11
1200bbe7cc Address review comments 2024-08-08 13:40:07 +03:00
kd-11
839a25e129 Bump scratch to 8k 2024-08-08 13:40:07 +03:00
kd-11
cba658baba Complete PPU support 2024-08-08 13:40:07 +03:00
kd-11
34549445a8 Migrate PPU to post-process execution model 2024-08-08 13:40:07 +03:00
kd-11
56cc5d9355 Initial PPU LLVM implementation for aarch64 2024-08-08 13:40:07 +03:00
Elad Ashkenazi
33851d51ab Fixup and Improve CELL reservation notifications 2024-07-01 18:59:26 +03:00
Elad Ashkenazi
f948a80242 CELL: More efficient reservation notificatins 2024-06-30 07:46:14 +03:00
Elad Ashkenazi
87f5368d3c PPU: Fix access violation on logging 2024-06-23 19:29:13 +03:00
Elad Ashkenazi
0b22423ab8 Minor fs::file usage fixes
Do not crash on file creation failure. Make some config writes atomic.
2024-06-10 13:45:23 +03:00
Elad Ashkenazi
6fff22391c PPU Analyzer: Utilize exported functions 2024-06-08 14:09:37 +03:00
Elad Ashkenazi
26b21ed031 LLVM: Prevent crash on disk space shortage 2024-05-30 11:41:24 +03:00
Eladash
f9345c7699 SPU LLVM: PUTLLC 16 Optimization
Also, do not check LR event if already raised in PUTLLC
2024-05-21 16:37:54 +03:00
Megamouse
04d6ff274b Move cache dir code to utils 2024-05-07 08:47:29 +02:00
Megamouse
c11c286206 Adust vsh cache dir criteria 2024-05-07 08:47:29 +02:00
Megamouse
f418ad74f5 VSH: move cache to /cache/vsh/ 2024-05-07 08:47:29 +02:00
Megamouse
dff7352e2e llvm: silence warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 2024-04-20 01:38:11 +02:00
Eladash
7bf8917c08 PPU LLVM: Fix crash in Unity games 2024-04-19 20:51:37 +03:00
Eladash
103b2fe5fd PPU/reservations: send thread notification only if data changed 2024-04-12 09:58:30 +03:00
Eladash
597a9f6dd6 PPU Loader: Fix unload of HLEd PRX modules 2024-04-01 12:20:38 +03:00
Eladash
e90b399329 PPU LLVM: Fix leak of modules outside dev_flash/sys/internal
Cache path was not matching on removal
2024-03-30 21:58:26 +03:00