rpcsx/rpcs3/Emu
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
..
Audio sys_rsxaudio: use max channel count from configured sound_modes 2022-06-09 18:59:13 +02:00
Cell PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
CPU PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
Io HID: optimize get_next_button_press a bit 2022-06-05 19:07:03 +02:00
Memory vm_native.cpp: Use Windows 10 memory mapping API (the correct API) 2022-06-10 14:27:02 +03:00
NP Add a message overlay 2022-05-23 08:38:02 +02:00
RSX PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
cache_utils.cpp Wipe clean VSH's temporary directory of choice at boot 2022-05-21 10:57:12 +03:00
cache_utils.hpp Move unspecific Emulator code out of System.cpp 2021-04-24 11:21:22 +03:00
CMakeLists.txt gl: Refactor image and command-context handling 2022-06-04 14:02:33 +03:00
GameInfo.h Move types.h to util/types.hpp 2020-12-12 15:12:01 +03:00
GDB.cpp sys_net refactor (#11740) 2022-04-09 14:51:22 +02:00
GDB.h Implement fill_array() utility 2021-04-19 12:33:32 +03:00
IdManager.cpp core: Move IDM to FXO 2021-04-04 17:29:32 +03:00
IdManager.h Improve emulation stopping speed 2021-06-08 18:26:14 +03:00
IPC.h LV2: Improve IPC support (#10206) 2021-05-07 09:58:30 +03:00
localized_string.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
localized_string.h Remove BOM markers 2020-12-06 15:30:12 +03:00
localized_string_id.h Add a message overlay 2022-05-23 08:38:02 +02:00
perf_meter.cpp Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
perf_meter.hpp Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
perf_monitor.cpp Log cpu usage periodically 2022-03-16 19:42:06 +01:00
perf_monitor.hpp Log cpu usage periodically 2022-03-16 19:42:06 +01:00
System.cpp Optimize emulation stopping for when cellSysutilCheckCallback is not called 2022-06-06 19:21:41 +02:00
System.h cellAudioOut: Use bev_bdvd for disc game PARAM.SFO 2022-06-05 13:34:34 +02:00
system_config.cpp Qt: fix initial TSX selection 2021-11-06 13:47:43 +01:00
system_config.h rsx: Improve Null Renderer 2022-06-12 20:54:42 +03:00
system_config_types.cpp rsx: Implement atomic FIFO fetching (stability improvement) (non-default setting) (#12107) 2022-06-04 15:35:06 +03:00
system_config_types.h rsx: Suggest to try setting RSX FIFO Accuracy to a higher mode of accuracy on crash (#12204) 2022-06-11 23:26:12 +02:00
system_progress.cpp Log cpu usage periodically 2022-03-16 19:42:06 +01:00
system_progress.hpp overlays: Show feedback while stopping ppu compilation 2021-09-16 22:18:43 +02:00
system_utils.cpp Return NPD header in verify_npdrm_self_headers and VerifyEDATHeaderWithKLicense 2022-05-10 23:24:00 +02:00
system_utils.hpp Use simpler C00 unlock EDAT check in GUI 2022-03-09 22:39:30 +03:00
title.cpp Cleanup and move sysinfo.h -> util/sysinfo.hpp 2020-12-18 12:55:54 +03:00
title.h Remove BOM markers 2020-12-06 15:30:12 +03:00
VFS.cpp fix vfs::host::rename. 2022-03-21 08:49:01 +03:00
VFS.h Improve Trophy Installer robustness 2020-10-01 22:00:57 +03:00
vfs_config.cpp VFS: Add device_info to vfs config 2022-05-10 19:39:35 +02:00
vfs_config.h VFS: Add device_info to vfs config 2022-05-10 19:39:35 +02:00