Commit graph

61 commits

Author SHA1 Message Date
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
Nekotekina b21fce4d6f IdManager improved
lv2_obj for kernel objects
Simple lookup (vector)
Another idm API refactoring
2017-01-29 21:37:04 +03:00