rpcsx/rpcs3/Emu/Cell/lv2
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
..
sys_net More verbose errors in nt_p2p_port 2022-05-27 08:56:39 +02:00
lv2.cpp PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
sys_bdemu.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_bdemu.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_btsetting.cpp VSH: Stubs 2020-02-08 23:07:03 +03:00
sys_btsetting.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_cond.cpp Simplify PPU exit 2021-05-25 22:47:23 +03:00
sys_cond.h LV2: Fixup for IPC 2021-05-07 14:58:22 +03:00
sys_config.cpp More random changes 2021-04-11 14:01:51 +03:00
sys_config.h More random changes 2021-04-11 14:01:51 +03:00
sys_console.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_console.h VSH: Stubs 2020-02-08 23:07:03 +03:00
sys_crypto_engine.cpp VSH: Stubs 2020-02-08 23:07:03 +03:00
sys_crypto_engine.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_dbg.cpp Fix vm::range_lock, imporve vm::check_addr 2020-11-11 10:30:09 +03:00
sys_dbg.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_event.cpp sys_event: Fix PPU queue forced uproot of waiters (#11147) 2021-11-13 20:22:54 +03:00
sys_event.h event queue: Structure size efficiency 2021-05-09 10:58:14 +03:00
sys_event_flag.cpp Fix sys_event_flag_wait result set (#10404) 2021-06-05 16:41:02 +03:00
sys_event_flag.h event queue: Structure size efficiency 2021-05-09 10:58:14 +03:00
sys_fs.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_fs.h Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_gamepad.cpp More random changes 2021-04-11 14:01:51 +03:00
sys_gamepad.h Replace uint8_t with u8 2020-12-18 12:23:53 +03:00
sys_gpio.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_gpio.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_hid.cpp Fix some warnings 2021-07-30 09:31:36 +03:00
sys_hid.h sys_hid vsh 2021-07-18 14:20:33 +02:00
sys_interrupt.cpp Fix cellVdec regression to be harmonized with the new interrupts model 2022-05-25 17:36:28 +03:00
sys_interrupt.h sys_interrupt: weak_ptr -> shared_ptr 2021-05-15 00:31:14 +03:00
sys_io.cpp Stub sys_io for vsh. 2021-07-17 17:06:57 +02:00
sys_io.h Stub sys_io for vsh. 2021-07-17 17:06:57 +02:00
sys_lwcond.cpp Bugfix of sys_lwmutex_destroy 2021-08-04 09:03:17 +03:00
sys_lwcond.h event queue: Structure size efficiency 2021-05-09 10:58:14 +03:00
sys_lwmutex.cpp Remove some lwmutex log spam 2021-09-26 21:28:17 +03:00
sys_lwmutex.h Bugfix of sys_lwmutex_destroy 2021-08-04 09:03:17 +03:00
sys_memory.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_memory.h Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_mmapper.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_mmapper.h sys_mmapper: Fix IPC-enabled instances memory consumption 2021-05-24 23:16:06 +03:00
sys_mutex.cpp LV2: Fixup for IPC 2021-05-07 14:58:22 +03:00
sys_mutex.h event queue: Structure size efficiency 2021-05-09 10:58:14 +03:00
sys_net.cpp fix lv2_socket_native::accept 2022-05-23 07:36:51 +02:00
sys_net.h sys_net refactor (#11740) 2022-04-09 14:51:22 +02:00
sys_overlay.cpp Fixes of PS3 filesystem EDAT/SDAT handling 2021-11-04 21:32:15 +03:00
sys_overlay.h Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
sys_ppu_thread.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_ppu_thread.h kernel-explorer: Implement PPU scheduler state information 2021-05-21 18:12:36 +02:00
sys_process.cpp Implement sys_process_exit3 2022-05-19 13:59:52 +03:00
sys_process.h sys_rsxaudio: Add id to kernel explorer and some fixes 2022-05-23 13:10:46 +02:00
sys_prx.cpp Fixes of PS3 filesystem EDAT/SDAT handling 2021-11-04 21:32:15 +03:00
sys_prx.h sys_prx: more constants 2021-04-23 22:02:52 +02:00
sys_rsx.cpp rsx: Resurgence of HLE GCM 2022-06-06 12:56:25 +02:00
sys_rsx.h lv2: Make some struct declarations uniform 2022-05-20 16:29:27 +03:00
sys_rsxaudio.cpp sys_rsxaudio: use max channel count from configured sound_modes 2022-06-09 18:59:13 +02:00
sys_rsxaudio.h sys_rsxaudio: use max channel count from configured sound_modes 2022-06-09 18:59:13 +02:00
sys_rwlock.cpp LV2: Fixup for IPC 2021-05-07 14:58:22 +03:00
sys_rwlock.h event queue: Structure size efficiency 2021-05-09 10:58:14 +03:00
sys_semaphore.cpp LV2: Fixup for IPC 2021-05-07 14:58:22 +03:00
sys_semaphore.h event queue: Structure size efficiency 2021-05-09 10:58:14 +03:00
sys_sm.cpp sys_sm_get_ext_event2 stub 2021-07-17 18:35:26 +02:00
sys_sm.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_spu.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_spu.h Debugger/Disasm: Name SPU Syscalls 2021-09-07 01:13:57 +02:00
sys_ss.cpp Fix some warnings 2021-07-30 09:31:36 +03:00
sys_ss.h More random changes 2021-04-11 14:01:51 +03:00
sys_storage.cpp Fix sys_storage_read 2021-07-30 17:22:43 +03:00
sys_storage.h sys_storage vsh implementation (#10559) 2021-07-17 22:06:40 +02:00
sys_sync.h LV2: Fix IPC key reading from attributes 2021-07-17 20:02:21 +02:00
sys_time.cpp sys_rsxaudio: Initial implementation (#11907) 2022-05-05 15:47:44 +02:00
sys_time.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_timer.cpp lv2_timer: manage timers by separate thread (#10445) 2021-06-15 15:04:51 +03:00
sys_timer.h lv2_timer: manage timers by separate thread (#10445) 2021-06-15 15:04:51 +03:00
sys_trace.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_trace.h Move types.h to util/types.hpp 2020-12-12 15:12:01 +03:00
sys_tty.cpp Warning Fixes 2022-03-23 19:35:10 +01:00
sys_tty.h Add debugging info for when sys_tty_write is executed 2021-09-12 19:05:26 +03:00
sys_uart.cpp sys_rsxaudio: Add id to kernel explorer and some fixes 2022-05-23 13:10:46 +02:00
sys_uart.h More sys_uart packets (#11332) 2022-01-10 03:43:54 +03:00
sys_usbd.cpp Add Top Shot Elite controllers to whitelist 2022-05-05 22:33:50 +02:00
sys_usbd.h Impl sys_usbd_get_device_location 2021-11-25 00:53:00 +01:00
sys_vm.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
sys_vm.h Remove BOM markers 2020-12-06 15:30:12 +03:00