Commit graph

1053 commits

Author SHA1 Message Date
Eladash cf4da5c4d1 CPU preemption control: bugfixes 2022-09-16 18:57:55 +03:00
Eladash 9c5108c1ca CPU preemption control: Add one more debug variable 2022-09-16 18:57:55 +03:00
Eladash ec7b18dab5 Implement independent CPU preemptions 2022-09-13 19:28:20 +03:00
brian218 b9e20dc5c9 sys_game_board_storage_read(): Fix regression after #12637 2022-09-13 12:57:43 +03:00
Eladash cfdc852f03 SPU: Power consumption reduction when using SPU inaccurate reservations 2022-09-13 11:21:01 +03:00
Yui 9e83bc6544
Add the ability to set the PSID from the configuration (#12637) 2022-09-12 13:23:13 +03:00
Eladash 37aefe5811 sys_ppu_thread: Fix max thread name size 2022-09-12 12:57:39 +03:00
Eladash 48382564d1 SPU: Implement "quintuple" Inbound MBOX storage 2022-09-07 20:42:23 +03:00
Eladash 5e2424da58 IdManager.cpp: Fix cellFs IDs 2022-09-07 17:05:51 +03:00
Eladash 7698064f5a SPU: Untangle VM lock to avoid deadlocks 2022-09-07 16:05:56 +03:00
brian218 75efc79930 Implemented sys_game_board_storage_read() 2022-09-04 13:28:05 +03:00
brian218 698c3415ea Fixed SIG: Thread terminated due to fatal error: Failed to read hex string: invalid argument
Fixed the error which occurred when a game attempted to read the VID/PID of an undefined VFS USB device:

SIG: Thread terminated due to fatal error: Failed to read hex string: invalid argument
(in file C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\rpcs3\Emu\Cell\lv2\sys_fs.cpp:1942[:25], in function sys_fs_fcntl)
2022-08-26 08:45:14 +02:00
Eladash c7586de280 Savestates/sys_fs: Fix saving encrypted and split-files file descriptors 2022-08-25 23:54:56 +03:00
Eladash ddba30988b vm: Attempt to not remove cpu_flag::wait flag during access violation 2022-08-21 15:02:01 +03:00
Eladash 7ff4509858 sys_lwcond: Fix a loose notification in cond wait 2022-08-11 12:44:40 +03:00
Eladash f2997e4c00 LV2: Fix the most annoying race ever
Timeline of the race:
1. The PPU is in SLEEP state. state = suspend.
2. lv2_obj::awake is called on the traced thread and is now in ONPROC state, state = signal.
3. lv2_obj::awake is called by another thread externally with a priority higher than our traced thread and appends it to g_pending. state = suspend + signal.
4. lv2_obj::sleep/set_priority (higering priority) is called on any thread which is in ONPROC. Causing it to enter SLEEP or RUNNING state, while the traced thread is back in queue in ONPROC. state = suspend + signal.
5. The traced thread finally calls lv2_obj::awake on itself, g_pending decrements to 0 and we a have a rescheduling event, after XOR state = 0!!! (no signal)
6. In check_state: cpu_sleep_called is now true and remains this way.
7. Another thread with a higher prioty kicks in and appends the traced thread into g_pending. state = suspend.
8. The traced thread is at cpu_thread::cpu_wait(), and that's where it's gonna spend the rest of its life.
2022-08-11 12:44:40 +03:00
Eladash 683c1a6512 LV2: Optimize sys_ppu_thread a bit 2022-08-11 11:42:16 +03:00
Eladash 9b0d33048c Savestates/LV2: Fix race on _sys_lwcond_queue_wait saving
cpu_flag::again modification requires exclusive access.
2022-08-11 11:42:16 +03:00
Eladash bc8bf2c329 sys_cond/lwcond: Fix waiting time in the debugger for mutex lock 2022-08-11 11:42:16 +03:00
Elad Ashkenazi f0002501f7 sys_mutex/lwmutex: Regression fixes after #12378 2022-08-11 11:42:16 +03:00
Elad Ashkenazi c4cc0154be LV2: Optimizations and fixes
Fix and optimize sys_ppu_thread_yield

Fix LV2 syscalls with timeout bug. (use ppu_thread::cancel_sleep instead)

Move timeout notification out of mutex scope

Allow g_waiting timeouts to be awaked in scope
2022-08-11 11:42:16 +03:00
Eladash 26e731b487 LV2: Re-add dropped optimization by previous commit
Currently only for lock-free syscalls.
2022-08-07 20:23:54 +03:00
Eladash 34bae90820 LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
Eladash 011aabe9ed LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
Eladash a17a6527f6 LV2: Move memory unlocking outside of mutex ownership and make it conditional 2022-08-07 20:23:54 +03:00
Eladash 73aaff1b29 LV2: allocation-free synchronization syscalls
* Show waiters' ID in kernel explorer.
* Remove deque dependency from sys_sync.h
2022-08-07 20:23:54 +03:00
Eladash c7fbc16357 SPU: Postpone notifications to afterward group mutex ownership 2022-08-07 20:23:54 +03:00
Eladash bc728db15b LV2: Add busy waiting before entering atomic wait 2022-08-07 20:23:54 +03:00
Eladash 2eebbd307d LV2: Minor optimization regarding signal flag 2022-08-07 20:23:54 +03:00
Eladash dc851a729e LV2: Postpone thread notifications to afterward mutex ownership(s) 2022-08-07 20:23:54 +03:00
Eladash 6007fd630f Do not use lv2_obj::g_waiting when not needed in sys_timer_usleep 2022-08-07 20:23:54 +03:00
Elad Ashkenazi 88b80ebdf5
sys_net: Fix missing locks in some syscalls (#12459) 2022-08-04 21:31:34 +03:00
Elad Ashkenazi 0e1931f178
sys_lwcond: Fix rare race on mode 3 signal (#12413) 2022-08-04 14:13:51 +03:00
Eladash bb9ae18c71 Savestates: Fix sys_rwlock_wunlock saving 2022-07-20 18:11:52 +03:00
Eladash ce01457510 Fix futile wait regression in sys_lwcond_signal 2022-07-20 18:11:52 +03:00
Eladash d106934336 Savestates: Fix saving sys_mutex_unlock 2022-07-19 10:43:51 +03:00
Eladash c887865d54 Perform cleanup after Emulator::Load failures 2022-07-19 10:43:51 +03:00
Eladash dc48944979 Prefer BDVD over HDD0 in vfs::retrieve 2022-07-19 10:43:51 +03:00
Eladash 12ebf77e22 Savestates: save sys_spu_initialize settings 2022-07-19 10:43:51 +03:00
Eladash c0369b2e10 sys_net: Implement sys_net_abort 2022-07-17 14:53:03 +03:00
Eladash e548743cbf Fixup rsx cpatures 2022-07-14 18:50:31 +03:00
Eladash cdd6840826 Savestates/SPU: Complete fix for saving sys_spu_thread_receive_event 2022-07-12 15:15:42 +03:00
Eladash befd7ceb89 Savestates/sys_spu: Minor fix in saving sys_spu_thread_receive_event 2022-07-10 14:19:59 +03:00
Vestrel 98b730c806
Audio: device switching and channel count detection (#12246) 2022-07-08 17:13:38 +02:00
Nekotekina 4b787b22c8 Implement FN (lambda shortener)
Useful for some higher order functions.
Allows to make short lambdas even shorter.
2022-07-08 14:47:41 +03:00
Eladash 3a9928de65 Savestates: Log file descriptor information 2022-07-08 12:57:43 +03:00
Eladash 1fd5fb2f7e Savestates: Fix minor race with LV2 timers 2022-07-08 12:57:43 +03:00
Eladash 5f8f9e33f1 RSX/Savestates: Replace GCM hack with a proper fix 2022-07-08 12:57:43 +03:00
Eladash f0c71ae2ae Savestates: Fix saving sys_event_queue_destroy 2022-07-08 12:57:43 +03:00
Eladash d8f3029952 Log LV2 periodic timers 2022-07-06 19:43:25 +03:00