Commit graph

113 commits

Author SHA1 Message Date
Eladash d86c9a2549 sys_mmapper: rewrite page fault thread notifications
* Fix a corner case where SPU thread has the same ID as a PPU thread.
* Fix a potential deadlock on Emu.Stop() while sending event in EBUSY loop.
* Thread specific notifications.
2020-06-18 20:13:54 +03:00
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