Eladash
9266507e4c
SPU: Implement spu_channel_(4_)t::try_read
2020-05-13 19:36:44 +03:00
Eladash
8cca113ef4
sys_spu: Add short sleep in sys_spu_thread_group_terminate
2020-05-13 19:36:44 +03:00
Eladash
7ff25588f4
sys_spu: Minor cleanup of group termination process
2020-05-13 19:36:44 +03:00
Eladash
f95b81574f
sys_spu: Fix race in sys_spu_thread_group_destroy and other minor fixes ( #8182 )
...
* sys_spu: Fix race in sys_spu_thread_group_destroy and other minor fixes
* SPU: Wait for all threads to have error codes if exited by sys_spu_thread_exit
On last thread in group to run.
* sys_spu: Fix sys_spu_thread_group_start
* fixup ad fix sys_spu_thread_group_terminate
idk why "- !group->running" was put in the first place but its probably no longer relevant due to other changes and was causing other issues such as not always waiting for last SPU thread to set group state to INITIALIZED.
2020-05-11 21:24:04 +03:00
Eladash
bd61347b21
sys_spu: reset group exit status in sys_spu_thread_group_start
2020-05-10 03:46:11 +01:00
Eladash
09797c3584
sys_spu: Improve sys_spu_thread_get_exit_status
2020-05-10 03:46:11 +01:00
Eladash
2b75df22d9
sys_event_queue: Fix ports disconnection after queue destruction
2020-04-30 18:58:42 +03:00
Eladash
f4f0fb88b1
kernel explorer: Add more information about SPU/PPU threads
2020-04-29 15:32:16 +03:00
Eladash
fe7933b0d2
Make ESTAT consistent in sys_spu_thread_group_terminate
2020-04-28 14:58:17 +03:00
Eladash
a3f2dfa232
sys_isolated_spu
2020-04-17 11:41:50 +01:00
Eladash
a9f492b605
sys_spu: Fix oops in sys_raw_spu_destroy after #7782
...
'id' is not the idm id, also explicitly join the thread so a situation where the thread is still active and communicating other threads (e.g via MMIO or MFC) yet its ID is removed won't happen. (logic breakage, destroyed thread can't be active)
2020-03-17 18:22:13 +03:00
Eladash
3566faabd9
Add missing lv2_obj::sleep when joining interrupt thread
2020-03-16 21:06:33 +03:00
Eladash
9e14e835e7
Fix sys_raw_spu_destroy
2020-03-16 21:06:33 +03:00
Eladash
c16124f0d9
idm: Fix minor race in cellVdecClose, sys_raw_spu_destroy...
...
Because of racing removal of IDs vs the shared pointer owned object
2020-03-14 18:30:14 +02:00
Eladash
af7cdcb5c7
Add forgotten error check in sys_spu_thread_group_connect_event
2020-03-09 16:07:14 +03:00
Eladash
1669e95870
Implement lv2_file::open()
...
Return accurate error codes in prx_load_module, sys_spu_image_open and overlay_load_module.
2020-03-06 21:16:46 +03:00
Eladash
4d3cdca7f6
Stub sys_spu_thread_group_set_cooperative_victims and syscall_253
2020-02-26 18:17:13 +00:00
Eladash
dd85e733d3
Fixup for #7304
2020-02-20 20:31:56 +03:00
Nekotekina
771eff273b
First part of fixing sign-compare warning (inside be_t).
2020-02-19 22:54:58 +03:00
Eladash
f02b4801b2
Fix max SPURS threads regression
2020-02-18 19:20:40 +00:00
Eladash
727d783959
RawSPU: protect NPC from writes/reads in running state
2020-02-18 18:09:10 +00:00
Eladash
fad8b38b28
sys_spu: protect sys_spu_image members in kernel mode
...
Save relevant info in idm, set sys_spu_image segs and nsegs members to 0.
2020-02-18 18:09:10 +00:00
Nekotekina
f08c778d2c
Use more starts_with/ends_with.
...
Remove ends_with global func.
2020-02-18 14:53:23 +03:00
Megamouse
fe75311be2
move config structs to own files and clean up some headers
2020-02-17 15:08:17 +03:00
Eladash
f8b3c48af7
sys_spu: Implement proper SPU group flags ( #7320 )
...
* sys_spu: Implement proper SPU group flags
2020-02-05 20:46:05 +00:00
Nekotekina
c0f80cfe7a
Use attributes for LIKELY/UNLIKELY
...
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina
6dfd97f0b6
Modernize SPU logging (spu_log variable) and remove log legacy
...
Remove legacy macro (LOG_ERROR, etc)
2020-02-01 11:52:52 +03:00
Nekotekina
3eca2d5d6c
Remove legacy LOADER log channel
2020-02-01 07:49:38 +03:00
Eladash
4e0070f16d
Log sys_spu thread group and thread names
...
Also safely read thread name after relevant error checks passed.
2020-01-26 20:32:10 +00:00
Eladash
b07b5c9005
Fix sys_spu_thread_initialize for attr->name_len is 0 and attr->name is not null
...
If name_len is 0 name is empty, in any other case name is not empty (attr->name == nullptr isn't allowed in this case).
Check name_len and option for invalid values as fw.
2020-01-18 18:46:13 +03:00
Eladash
71c4a2a15f
Silence some log messages
2019-12-31 22:27:27 +03:00
Eladash
c2eb9a583d
Implement ps3 application root flags detection
2019-12-31 22:22:06 +03:00
Eladash
45cff1219c
Allow sys_raw_spu_create_tag to be called more than once
2019-12-30 23:46:45 +03:00
Eladash
5631382623
sys_spu: Fix SPU Thread Id
...
* Removed wrong code in sys_spu_thread_group_terminate.
* SPU Thread ID is accurate, including 5th thread id "rule".
* Fixed possible use-after-free access of spu_thread::group member.
* RawSPU ID management simplified.
2019-12-06 19:59:29 +03:00
Eladash
a2c69e4a2e
sys_spu_thread_group_dis/connect_event Improvements
2019-12-05 23:31:46 +03:00
Nekotekina
bf11a28fb5
C-style cast cleanup IV
2019-12-01 22:12:33 +03:00
Eladash
8bd52c9843
Fix sys_spu_thread_un/bind_queue queue existence check
2019-11-28 01:54:45 +03:00
Eladash
9cc3838e49
Fix possible division by zero in sys_spu_thread_write/read_ls
2019-11-28 01:54:45 +03:00
Eladash
b8220ec12f
Stub sys_spu_thread_group_log
2019-11-28 01:54:45 +03:00
Eladash
b99992d570
sys_spu: Fix SNR and Inbound Mailbox state reset
...
Also remove bugged ESTAT check at sys_spu_thread_write_spu_mb.
2019-10-29 18:34:28 +03:00
eladash
95752607ea
sys_spu: Don't reset snr config at group_start()
...
Also first check for EINVAL in sys_spu_thread_set_spu_cfg
2019-10-16 21:11:29 +03:00
Nekotekina
7a00b5f809
Use g_fxo for patch_engine
2019-08-27 03:50:15 +03:00
Nekotekina
54952f6ad6
Use g_fxo for LoadedNpdrmKeys_t
...
Rename to loaded_npdrm_keys
2019-08-22 02:13:39 +03:00
Eladash
0dce6be8cb
Implement lv2_spu_image
...
- Improved sys_spu_image_.. error checking
- sys_process SYS_SPUIMAGE_OBJECT handling implemented
2019-08-16 23:49:24 +03:00
Eladash
cd4e895c04
Use error_code in mmapper_thread_recover_page_fault
2019-08-13 04:56:00 +03:00
Nekotekina
cfa1416d64
sys_spu: add vm::temporary_unlock
2019-07-14 18:33:23 +03:00
msuih
d57124d075
Explicitly cast size_t to integer types
2019-07-01 04:33:23 +03:00
Eladash
1ee7b91646
Refactoring ( #6143 )
...
Prefer vm::ptr<>::ptr over vm::get_addr.
Prefer vm::_ptr/base over vm::g_base_addr with offset.
Added methods atomic_t<>::bts and atomic_t<>::btr .
Removed obsolute rsx:🧵 :Read/WriteIO32 methods.
Removed wrong check in semaphore_release.
Added handling for PUTRx commands for RawSPU MFC proxy.
Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise.
Fixed more potential overflows that may result in wrong behaviour.
Added io/size alignment check for sys_rsx_context_iounmap.
Added rsx::constants::local_mem_base which represents RSX local memory base address.
Removed obsolute rsx:🧵 :main_mem_addr/ioSize/ioAddress members.
2019-06-29 01:27:49 +03:00
Lassi Hämäläinen
c963c51a60
Remove unnecessary header includes
...
- Manually removed lot of unneeded #includes to clean code and reduce
compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +03:00
Nekotekina
ea554ae828
Implement 'Max SPURS Threads' option (hack)
...
Pauses SPURS threads beyond limit automatically if set.
2019-05-14 22:15:04 +03:00
Nekotekina
7492f335e9
SPU analyser: basic function detection in Giga mode
...
Misc: fix EH frame registration (LLVM, non-Windows).
Misc: constant-folding bitcast (cpu_translator).
Misc: add syntax for LLVM arrays (cpu_translator).
Misc: use function names for proper linkage (SPU LLVM).
Changed function search and verification in Giga mode.
Basic stack frame layout analysis.
Function detection in Giga mode.
Basic use of new information in SPU LLVM.
Fixed jump table compilation in SPU LLVM.
Disable broken optimization in Accurate xfloat mode.
Make compiled SPU modules position-independent in SPU LLVM.
Optimizations include but not limited to:
* Compiling SPU functions as native functions when eligible
* Avoiding register context write-out
* Aligned stack assumption (CWD alike instruction)
2019-05-11 02:13:19 +03:00
eladash
4a28319edf
Implement SPU page faults notifications
...
* Implement both RawSPU and threaded SPU page fault recovery
* Guard page_fault_notification_entries access with a mutex
* Add missing lock in sys_ppu_thread_recover_page_fault/get_page_fault_context
* Fix EINVAL check in sys_ppu_thread_recover_page_fault, previously when the event was not found begin() was erased and
CELL_OK was returned.
* Fixed page fault recovery waiting logic:
- Do not rely on a single thread_ctrl notification (unsafe)
- Avoided a race where ::awake(ppu) can be called before ::sleep(ppu) therefore nop-ing out the notification
* Avoid inconsistencies with vm flags on page fault cause detection
* Fix sys_mmapper_enable_page_fault_notification EBUSY check
from RE it's allowed to register the same queue twice (on a different area) but not to enable page fault notifications twice
2019-03-12 13:28:31 +03:00
Nekotekina
f143035af1
Fix sys_spu_thread_group_join wait condition
...
After waiting, thread group cannot be safely accessed
Following #5643
2019-03-01 00:08:19 +03:00
eladash
fa647bc121
Fix race condion in sys_spu_thread_group_join
2019-02-10 18:20:24 +03:00
eladash
84d42ecb65
Add EFAULT checks to spu_thread_group_join, ppu_thread_join
...
Order of checks is based on firmware
2019-02-10 00:16:57 +03:00
eladash
e3ee481f01
Make sys_spu_thread_group_join return once per termination
2019-02-10 00:16:57 +03:00
Nekotekina
cfdf50dcff
SPU: ensure sys_spu_thread_group_join receives correct exit status
...
Following #5334
2019-01-13 14:45:36 +03:00
eladash
653a4ef0df
Set group status INIT on last thread stopped
...
this fixes the group status after sys_spu_thread_exit when not joining the spu group
2018-12-25 19:59:41 +03:00
Nekotekina
f442a8a84c
SPU TG: add thread group stop counter
...
Fix possible race condition introduced by waiting on `running` value
2018-11-27 23:37:26 +03:00
Nekotekina
0044eb44e2
Cleanup after #5310 (SPU thread groups)
...
Move lambda into a cpu_stop()
Use running thread counter to synchronize with sys_spu_thread_group_join()
Use SPU_STATUS_STOPPED_BY_STOP exclusively for sys_spu_thread_exit() as before
Remove unnecessary waiting in sys_spu_thread_group_exit()
Rollback some minor unnecessary changes
Use shared_mutex in SPU TG
2018-11-14 12:50:24 +03:00
RipleyTom
0e0a82e536
Ensures threads are stopped in join
2018-11-13 10:19:28 +03:00
Nekotekina
1b37e775be
Migration to named_thread<>
...
Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
2018-10-19 22:22:35 +03:00
Nekotekina
dce14a359a
Rename lv2_spu_group::num to max_num
2018-09-19 14:15:15 +03:00
Nekotekina
ca5158a03e
Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
...
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard
Change semaphore<> interface to Lockable (+ exotic try_unlock method)
2018-09-03 23:00:36 +03:00
Nekotekina
363811981d
Reintroduce LOG_CHANNEL
...
Groundwork for further improvements
2018-08-25 15:39:00 +03:00
eladash
f349695a75
Rsx: rewrite address translation
2018-08-13 16:16:34 +03:00
Ofek
2bc4cb4e58
Fix sys_spu_thread_connect event
2018-06-16 19:05:51 +04:00
Nekotekina
898637f830
Remove mfc_thread
...
Clear mfc_queue on reset
Improve MFC Proxy a bit
2018-03-31 21:13:12 +03:00
eladash
63fa50080d
sys_spu: dont check prio if spu group type is 0x20
...
it's currently unknown whats the exact relationship between the prio and the group type SYS_SPU_THREAD_GROUP_TYPE_COOPERATE_WITH_SYSTEM (0x20).
tho we do know prio'es whom less than 16 are reserved for the system.
2018-03-24 19:48:14 +04:00
eladash
fad9cd6ef1
sys_spu: fix spu image loading address calculation
...
by calculating mem_size after nsegs has being calculated
2018-03-24 19:48:14 +04:00
Nekotekina
cce0ad0c35
Clean vm::ps3 namespace use
2018-02-09 17:49:37 +03:00
Nekotekina
76be7d40ac
Remove PSP2
2018-02-09 15:24:46 +03:00
elad
5b5f2d4240
hle: add a missing check in sys_spu
...
check if exit code exists and the spu is stopped by a stop instruction
and optimize the way were getting the exit code
2018-02-06 04:09:07 +04:00
Ofek
58c42ad9c0
Check sys_spu_thread_group_create's nsize ( #3742 )
...
* Check sys_spu_thread_group_create's nsize
* cellSearch callback correction
2017-11-23 02:02:23 +04:00
clienthax
946ba3be29
Fix bug in sys_spu_thread_group_create ( #3734 )
2017-11-14 22:24:55 +04:00
Nekotekina
5b00aaf561
Fix decrypt_self usage
2017-09-01 02:10:57 +03:00
Nekotekina
05442bdb11
Protect SPU segments
2017-09-01 00:59:25 +03:00
Nekotekina
90b8346312
Implemented syscall _sys_spu_image_get_segments
2017-08-31 21:39:12 +03:00
Nekotekina
167d6a08f8
Implemented syscall _sys_spu_image_get_information
2017-08-31 21:30:13 +03:00
Nekotekina
b533d57717
sys_spu_image: minor update
...
Cleanup
Templates extended
2017-08-31 20:36:51 +03:00
Nekotekina
f59a448f3f
Copy sys_spu_segment info in SPU TG
...
No idea whether it fixes something or not
2017-08-27 03:00:10 +03:00
Nekotekina
aa5dc5455e
_sys_spu_image_import implemented
...
vm:var<T[]> improved (begin/end)
sys_spu_image_import rewritten
2017-08-27 03:00:10 +03:00
Nekotekina
3f9affd2ad
Stub some SPU syscalls
2017-07-23 11:03:38 +03:00
Nekotekina
f91f2e3e6d
Patch: add floating point support
...
Also count applied entries
2017-07-17 18:36:54 +03:00
Nekotekina
e39ee10105
Patch system improved
...
SPU patch rewritten
PPU patch implemented
2017-07-17 16:49:46 +03:00
Nekotekina
9a38d63661
Store sys_spu_image value
2017-07-12 14:00:38 +03:00
Nekotekina
88fef183a3
config.yml: Log section optimized
2017-05-15 14:37:05 +03:00
Nekotekina
402df68235
sys_spu_image loading rewritten
2017-04-16 17:44:20 +03:00
scribam
9ba0a9189b
Update sys_spu
...
- Implement sys_spu_thread_group_set_priority
- Implement sys_spu_thread_group_get_priority
2017-04-10 04:08:55 +03:00
Nekotekina
3ec156b2f2
Enable patch engine for SPU images
2017-03-30 12:04:59 +03:00
Nekotekina
4739eb3601
Reservation fix
2017-03-11 15:48:43 +03:00
Nekotekina
5e3bacbd9b
New reservations
...
Memory system cleanup
sys_memory_get_page_attribute
2017-03-10 15:51:40 +03:00
Nekotekina
9000407a77
cpu_thread::test_state added
...
lv2_obj::sleep adjustment
synchronization fixes
2017-02-22 13:23:21 +03:00
Nekotekina
598c90f376
PPU thread scheduler
2017-02-13 22:26:11 +03:00
Nekotekina
e8bfce4ebd
decrypt_self() function
...
Fixed SPU self decryption
Fixed PSV debug self load
2017-02-11 21:36:48 +03:00
Nekotekina
246b9f3182
CHECK_EMU_STATUS removal
2017-02-05 17:35:27 +03:00
Nekotekina
11b0b6958f
sys_spu diag
2017-02-05 15:48:11 +03:00
Nekotekina
ec943b38a2
sys_spu...
2017-02-05 02:26:57 +03:00
Nekotekina
68f0393cf3
sys_interrupt...
2017-02-04 20:39:04 +03:00
Nekotekina
6537909fd2
sys_event_queue...
2017-02-04 20:39:04 +03:00