Commit graph

147 commits

Author SHA1 Message Date
Megamouse 16f869fe5a logging: minor trace optimizations 2023-06-15 19:48:15 +02:00
Eladash 636bde6343 Logs: Fix trailing space, nbsp and unintended character 2023-06-06 09:48:27 +02:00
brian218 c85775922e sys_usbd: Implemented sys_usbd_unregister_extra_ldd() 2023-06-05 13:51:54 +03:00
Eladash b861a9c5d0 LV2: Implement set-priority thread requeue 2023-06-02 08:54:46 +03:00
Eladash 9828e6cafc LV2: Push other-than-this thread to the back on priority set 2023-06-02 08:54:46 +03:00
brian218 98c46f7eb0 sys_game: Fixed potential bugs in sys_game_get_system_sw_version()
sys_game: Implemented sys_game_set_system_sw_version()
2023-05-06 10:26:37 +03:00
Megamouse cd9ff08235 Decrease some include madness 2023-04-26 21:37:44 +02:00
Eladash 0beda6fa89 Savestates: Fix deadlock on savestate load 2023-03-18 12:07:17 +03:00
Margen67 5bb89328d0 Remove whitespace 2023-02-15 08:58:02 +01:00
brian218 53e906d0f3 sys_game: Implemented sys_game_board_storage_write() & Made it modifiable 2023-02-04 22:19:59 +01:00
Eladash 5aced2e44b Print LV2 Syscall Usage only if increased since last print 2023-01-28 17:21:45 +01:00
brian218 49455965c0 sys_game: Implemented sys_game_get_rtc_status() & Updated sys_game_board_storage_read() 2023-01-26 15:52:45 +01:00
Elad Ashkenazi 0946e5945f
VSH Improvements (#13172)
* sys_prx: Implement PRX LIB register syscall

* VSH: partial log spam fix

* sys_process reboot fix

* Implement sys_memory_container_destroy_parent_with_childs

* sys_net: Implement SO_RCVTIMEO/SO_SENDTIMEO

* VSH: Implement sys_rsx_context_free

* PPU LLVM: distinguish PPU cache exec also by address

Fixes referencing multiple PRX.

* UI: Do not report size of apps inside /dev_flash
2023-01-09 20:03:01 +03:00
brian218 65ae85061f
Misc and minor improvements of syscalls used by VSH (#13067) 2022-12-13 07:33:17 +01:00
brian218 3cb9cd7724
sys_fs: Minor fixup (#12913)
Stubbed sys_fs_newfs
2022-11-01 19:49:50 +03:00
brian218 61a371b106 Implemented sys_fs_mount() and sys_fs_unmount() 2022-10-28 08:51:41 +02:00
brian218 5c24009eb5 Implemented sys_game_watchdog syscalls 2022-10-17 20:32:01 +03:00
brian218 e839595053 Implemented sys_game_get_system_sw_version() 2022-10-11 08:32:49 +02:00
Eladash d25d1ecb3a LV2: Avoid using multi-variable atomic waiting on cpu_thread::state wait 2022-10-04 16:28:34 +03:00
Nekotekina b49a1f27eb Warning fixes 2022-09-17 16:35:02 +03:00
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 75efc79930 Implemented sys_game_board_storage_read() 2022-09-04 13:28:05 +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
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 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 dc851a729e LV2: Postpone thread notifications to afterward mutex ownership(s) 2022-08-07 20:23:54 +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
Elad Ashkenazi fcd297ffb2
Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
Jeff Guo cefc37a553
PPU LLVM arm64+macOS port (#12115)
* BufferUtils: use naive function pointer on Apple arm64

Use naive function pointer on Apple arm64 because ASLR breaks asmjit.
See BufferUtils.cpp comment for explanation on why this happens and how
to fix if you want to use asmjit.

* build-macos: fix source maps for Mac

Tell Qt not to strip debug symbols when we're in debug or relwithdebinfo
modes.

* LLVM PPU: fix aarch64 on macOS

Force MachO on macOS to fix LLVM being unable to patch relocations
during codegen. Adds Aarch64 NEON intrinsics for x86 intrinsics used by
PPUTranslator/Recompiler.

* virtual memory: use 16k pages on aarch64 macOS

Temporary hack to get things working by using 16k pages instead of 4k
pages in VM emulation.

* PPU/SPU: fix NEON intrinsics and compilation for arm64 macOS

Fixes some intrinsics usage and patches usages of asmjit to properly
emit absolute jmps so ASLR doesn't cause out of bounds rel jumps. Also
patches the SPU recompiler to properly work on arm64 by telling LLVM to
target arm64.

* virtual memory: fix W^X toggles on macOS aarch64

Fixes W^X on macOS aarch64 by setting all JIT mmap'd regions to default
to RW mode. For both SPU and PPU execution threads, when initialization
finishes we toggle to RX mode. This exploits Apple's per-thread setting
for RW/RX to let us be technically compliant with the OS's W^X
    enforcement while not needing to actually separate the memory
    allocated for code/data.

* PPU: implement aarch64 specific functions

Implements ppu_gateway for arm64 and patches LLVM initialization to use
the correct triple. Adds some fixes for macOS W^X JIT restrictions when
entering/exiting JITed code.

* PPU: Mark rpcs3 calls as non-tail

Strictly speaking, rpcs3 JIT -> C++ calls are not tail calls. If you
call a function inside e.g. an L2 syscall, it will clobber LR on arm64
and subtly break returns in emulated code. Only JIT -> JIT "calls"
should be tail.

* macOS/arm64: compatibility fixes

* vm: patch virtual memory for arm64 macOS

Tag mmap calls with MAP_JIT to allow W^X on macOS. Fix mmap calls to
existing mmap'd addresses that were tagged with MAP_JIT on macOS. Fix
memory unmapping on 16K page machines with a hack to mark "unmapped"
pages as RW.

* PPU: remove wrong comment

* PPU: fix a merge regression

* vm: remove 16k page hacks

* PPU: formatting fixes

* PPU: fix arm64 null function assembly

* ppu: clean up arch-specific instructions
2022-06-14 15:28:38 +03:00
Eladash 7ddeb0d00f Implement sys_process_exit3 2022-05-19 13:59:52 +03:00
Vestrel d1e468fefb
sys_rsxaudio: Initial implementation (#11907) 2022-05-05 15:47:44 +02:00
Nekotekina 580bd2b25e Initial Linux Aarch64 support
* Update asmjit dependency (aarch64 branch)
* Disable USE_DISCORD_RPC by default
* Dump some JIT objects in rpcs3 cache dir
* Add SIGILL handler for all platforms
* Fix resetting zeroing denormals in thread pool
* Refactor most v128:: utils into global gv_** functions
* Refactor PPU interpreter (incomplete), remove "precise"
* - Instruction specializations with multiple accuracy flags
* - Adjust calling convention for speed
* - Removed precise/fast setting, replaced with static
* - Started refactoring interpreters for building at runtime JIT
*   (I got tired of poor compiler optimizations)
* - Expose some accuracy settings (SAT, NJ, VNAN, FPCC)
* - Add exec_bytes PPU thread variable (akin to cycle count)
* PPU LLVM: fix VCTUXS+VCTSXS instruction NaN results
* SPU interpreter: remove "precise" for now (extremely non-portable)
* - As with PPU, settings changed to static/dynamic for interpreters.
* - Precise options will be implemented later
* Fix termination after fatal error dialog
2022-01-15 06:48:04 +03:00
Vestrel 1adc408ad7
More sys_uart packets (#11332)
* Additional sys_uart packets added
2022-01-10 03:43:54 +03:00
Eladash f7b55ec8d4 lv2: Add missing reservation disowning in lv2_obj::yield 2021-11-22 14:48:34 +03:00
Eladash ab50e5483e
GUI Utilities: Implement instruction search, PPU/SPU disasm improvements (#10968)
* GUI Utilities: Implement instruction search in PS3 memory
* String Searcher: Case insensitive search
* PPU DisAsm: Comment constants with ORI
* PPU DisAsm: Add 64-bit constant support
* SPU/PPU DisAsm: Print CELL errors in disasm
* PPU DisAsm: Constant comparison support
2021-10-12 23:12:30 +03:00
clienthax d099148961 sys_hid vsh 2021-07-18 14:20:33 +02:00
Eladash 6a7324ab3e kernel_explorer: Atomic PPU state updates 2021-07-10 22:20:37 +03:00
Megamouse ac83871214 impressive typo fix 2021-05-31 23:01:13 +03:00
Eladash dcfd29c2d9 kernel-explorer: Implement PPU scheduler state information 2021-05-21 18:12:36 +02:00
Eladash 638f20c80f Improve get_current_cpu_thread() 2021-05-20 09:25:51 +03:00
Megamouse a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Nekotekina b3fb6d7d18 Add and fix -Wredundant-decls (GCC) 2021-03-23 22:48:57 +03:00
Eladash 729cd9284e debugger: Fix PPU threads pausing 2021-03-12 13:01:12 +03:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00