Commit graph

1833 commits

Author SHA1 Message Date
Nekotekina 688aabc6c9 Add _sys_lwmutex_unlock2 syscall name 2019-03-12 23:55:13 +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
eladash a43e7c172c Fix shared memory page flags
TODO: From hw testing, it seems like sys_memory_get_page_attribute and sys_rsx_context_iomap check page size a little differently

get_page_attribute() always go by area flags, sys_rsx_context_iomap checks page by the page granularity
This means that if the area page size 64k, but shared memory is mapped with SYS_MEMORY_GRANULARITY_1M
It can be mapped for rsxio, but the page attribute will indicate 64k page size :thonk:
rsxio memory is verified to need 1m pages.
2019-03-08 23:44:46 +03:00
eladash 7470388e5a Use error_code in sys_rsx 2019-03-08 23:44:46 +03:00
eladash 26bcd0a4de Small improvements to sys_event_flag
- From RE, only protocols SYS_SYNC_FIFO and SYS_SYNC_PRIORITY are valid
- Use conditional atomic op store in a few places
- Properly revert changes in sys_event_flag_set when aomic op fails
2019-03-08 23:44:46 +03:00
elad fc253165e2 Correctness fix for RSXIOMem
- Make RSXIOMem volatile.
- Hint the compiler to check only once the address returned.
2019-03-08 23:44:46 +03:00
elad b7da3ea5cd Release ppu thread before ShowSaveDataDialog, Fixes #4031 2019-03-08 23:44:46 +03:00
elad f272a5f779 sys_lwmutex fixup after #5680
sys_lwcond_wait unlocks always with the 'usual' unlocking flags
2019-03-08 23:44:46 +03:00
RipleyTom 61bd2ea799 Adds VID/PID for Guitar Hero guitar & drum 2019-03-08 17:52:48 +00:00
elad 3c9f03968c Yield before flushing io buffers in fsync (sys_fs) (#5506) 2019-03-08 16:07:14 +00:00
Nekotekina 4ea76def7c Update sys_lwmutex_lock and sys_lwmutex_unlock (liblv2 HLE)
Implement missing SYS_SYNC_RETRY logic
Following #5680
2019-03-06 15:09:50 +03:00
eladash e38b7aee5a check address in sys_rsx_context_iomap
* Fix 0 vm page flags to behave like 1m flags, follows c8a681e60
* check if address exists and valid for rsx io allcations (must be allocated on 1m pages)
2019-03-05 21:23:24 +03:00
Nekotekina fb64b28886 SPU LLVM: reintroduce branch patchpoints
Previously only used on SPU ASMJIT, may improve perf in some cases.
Now refactored to spu_runtime::make_branch_patchpoint.
2019-03-01 00:08:20 +03:00
Nekotekina 7f6a410770 Add dummy __has_builtin macro, use rotate builtins if possible 2019-03-01 00:08:19 +03:00
Nekotekina 765d15f23f Optimize SPU trampolines
Load values in EAX and reuse it if possible
2019-03-01 00:08:19 +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
RipleyTom de5379a69f Static hle implementation 2019-02-27 22:54:59 +03:00
eladash a22297f205 exception throwing fix in sys_lwmutex_create
arg6 doesnt exist, if arg4 is not negative name is discarded and treated as 0.
2019-02-27 22:16:08 +03:00
eladash d4459af4b3 Implement _sys_lwmutex_unlock (SYS_SYNC_RETRY mode) 2019-02-27 22:16:08 +03:00
RipleyTom ad6b0ee122 Adds class type to controller options 2019-02-27 18:13:19 +00:00
Megamouse b107718869 sysPrxForUser: improve crash dump functions
this might fix some crashes that could appear in the todo logging itself
2019-02-26 21:53:59 +00:00
German 45c31a99a3 Fix true clear string container in PPUModule.cpp 2019-02-18 16:34:16 +03:00
elad 63a9421634 Fix race in sys_lwcond_wait on error code 2019-02-16 21:41:59 +03:00
Megamouse d4888a4973 cellSysCacheMount: don't return RET_OK_RELAYED on empty cacheId
The system cache is supposed to be cleared but I don't think we wanna do that
2019-02-13 01:55:07 +03:00
Megamouse 4a1499e0be cellMsgDialog: optionally make dialogs blocking and fix exit condition
and apply review fixes
2019-02-12 21:06:10 +03:00
Megamouse fe79e541dd cellGame: improve exit functions 2019-02-12 21:06:10 +03:00
Megamouse 17a5e0bc98 cellGame: add error_code 2019-02-12 21:06:10 +03:00
eladash d6995f40c7 Fixup for sys_lwcond_signal_x error checking 2019-02-11 01:13:29 +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 0861226271 Make more use of the new atomic_t<>::release 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
kd-11 9ed9d7e947 overlays/osk: Implement native osk interface 2019-02-02 11:54:01 +03:00
eladash d4a24433e8 Fix DECR mode allocations (sys_memory) 2019-01-31 16:03:38 +03:00
Nekotekina 400718dfd9 cellSaveData: try to handle occasional failures
Retry moving directory on FILE_ACCESS_ERROR
2019-01-31 01:08:30 +03:00
Nekotekina 58358e85dd spu_runtime::add minor optimization
Use preallocated vectors in trampoline generation subroutine
2019-01-29 03:32:16 +03:00
Nekotekina 2b66abaf10 Implement atomic_t<>::release
More relaxed store with release memory order
2019-01-29 03:32:16 +03:00
Nekotekina 50922faac9 Remove SPUThread::jit_dispatcher
Use global array - save memory
Move the array to JIT memory
2019-01-29 03:32:16 +03:00
Nekotekina 4292997a01 Added jit_runtime class
Is a memory manager for ASMJIT, replaces asmjit::JitRuntime
Unified memory manager for ASMJIT and LLVM
Unified SPU trampoline generation
Remove previous workarounds
2019-01-29 03:32:16 +03:00
eladash 587fe421ee Make ppu main_thread unjoinable 2019-01-25 18:04:33 +03:00
eladash 56b7581ade Return error code in sys_ppu_thread_get_join_state 2019-01-25 18:04:33 +03:00
elad afeacc171f Fix spurious abort in sys_rwlock_tryrlock and sys_semaphore_trywait (#5579)
Use full cmpxchg loop to prevent occasional return of CELL_EBUSY
2019-01-22 23:10:17 +03:00
Nekotekina 4f152ad126 SPU: multithread compilation
Allow parallel compilation of SPU code, both at startup and runtime
Remove 'SPU Shared Runtime' option (it became obsolete)
Refactor spu_runtime class (now is common for ASMJIT and LLVM)
Implement SPU ubertrampoline generation in raw assembly (LLVM)
Minor improvement of balanced_wait_until<> and balanced_awaken<>
Make JIT MemoryManager2 shared (global)
Fix wrong assertion in cond_variable
2019-01-22 22:02:02 +03:00
Megamouse 8d5d44141e rsx/Qt: fix some undefined behavior in progress_dialog CallAfters 2019-01-22 12:04:01 +03:00
Nekotekina 59e0296281 cellMsgDialog: fix error spam on CELL_OK 2019-01-18 16:49:17 +03:00
eladash a11d76249d Patch ppu main thread prio 2019-01-17 21:58:09 +03:00
elad fc92ae4085 SPU/PPU atomics performance and LR event fixes (#5435)
* Fix SPU LR event setting in atomic commands according to hw test
* MFC: increment timestamp for PUT cmd in non-tsx path
* MFC: fix reservation lost test on non-tsx path in regard to the lock bit
* Reservation notification moved out of writer_lock scope to reduce its lifetime
* Use passive_lock/unlock in ppu atomic inctrustions to reduce redundancy
* Lock only once for dma transfers (non-TSX)
* Don't use RDTSC in reservation update logic
* Remove MFC cmd args passing to process_mfc_cmd
* Reorder check_state cpu_flag::memory check for faster unlocking
* Specialization for 128-byte data copy in SPU dma transfers
* Implement memory range locks and isolate PPU and SPU passive lock logic
2019-01-15 18:31:21 +03:00
eladash f19fd23227 spu: Fix support for multiple lists when one is stalled 2019-01-15 02:33:22 +03:00
Megamouse 58a22d1461 cellSaveData: add error_code 2019-01-14 21:12:13 +01:00
Nekotekina c5026f7109 cellVdec: fix minor race 2019-01-14 01:24:05 +03:00