Commit graph

422 commits

Author SHA1 Message Date
Megamouse 58140e1d3a Fix some warnings 2023-05-09 07:55:46 +02:00
Megamouse b86ecf7441 Keep preceding 0 in firmware strings 2023-04-19 08:06:30 +02:00
Megamouse 5107d1b69b Keep second 0 in firmware strings 2023-04-19 08:06:30 +02:00
Ivan Chikish fb88e1c1c9 Update to LLVM 16.0.0, switch to upstream LLVM 2023-04-06 10:19:31 +03:00
Megamouse 92ae57c9ee Windows: log more descriptive errors 2023-03-04 18:34:56 +01:00
Megamouse 3ff464641a Fix Visual Studio 17.5.0 compilation
For some reason there's an internal compiler error related to atomic wait.
I could work around this issue when I commented "mask = default_mask<X>;".
So after playing around a bit I had the suspicion that the VS parser can't handle some of the templatization.
Giving the decltype its own alias seems to fix this issue (and makes the code a bit more readable anyway in my opinion).
2023-02-25 19:20:55 +03:00
Megamouse ccb7528a59 fix some warnings 2023-02-22 23:57:20 +01:00
Ivan Chikish 01ed8a07af fixed_typemap.hpp: static allocation for m_init
This allows to safely call is_init<T>() at any time.
2023-02-23 00:54:35 +03:00
Megamouse 38d612e5ba fix some warnings 2023-02-22 00:15:11 +01:00
Margen67 5bb89328d0 Remove whitespace 2023-02-15 08:58:02 +01:00
Megamouse 24445123fc Recording: Fix possible encoder segfault 2023-01-18 00:24:00 +01:00
Megamouse 6bcb5ae66b Fix some includes and warnings 2023-01-10 20:57:32 +01:00
Megamouse 064ab58f3c cellRec: move data instead of memcpy 2022-12-10 03:24:40 +01:00
Megamouse 85c0a2e602 cellRec: add more logging 2022-12-10 03:24:40 +01:00
shinra-electric bf37087a10 Fix build errors by changing AVCodec* to a const
...rather than a variable. 

Allows RPCS3 to build on macOS again (Xcode 14.1)
2022-12-09 14:21:37 +03:00
Megamouse 88269636d3 utils: implement video encoder and image sink 2022-12-08 21:08:37 +01:00
Elad Ashkenazi 630edde10f
logs.cpp: fix regression (#12995)
Fixes #12994
2022-11-29 22:56:18 +03:00
Eladash e9e139c364 logs improvements
* Do not use unsafe pointer arithmetics exceeding existing memory. (exceeding m_fptr)
* Properly use the enire 32MB of the buffer, previously only 16MB were used for cuncurrent access.
* Fix a bug occurring after attempting to push 1TB (40 bits).
* Flush the log before hitting a debugging breakpoint.
2022-11-28 18:52:11 +03:00
Nekotekina 1123e25136 Implement ref_ptr (see read_from_ptr)
Type `aref`: reference wrapper
2022-11-26 09:30:11 +03:00
Nekotekina 7c15001042 Implement read_from_ptr<>() util
Doing std::bit_cast on a "span".
Should be usable in constexpr.
2022-11-26 09:30:11 +03:00
Nekotekina ae809ad320 Unexpected bugfixes
Mostly unaligned memory access.
Also includes workarounds for ubsan execution.
2022-10-31 14:20:02 +03:00
Malcolm Jestadt d8897c585d PPU/SPU LLVM: Allow Zen4 cpus to use VPERMI2B/VPERMT2B instead of the vperm2b256to128 path
- Zen4 based cpus can process VPERM2B in a single uop, unlike intel where it is 3 uops.
2022-10-01 15:38:29 +03:00
Nekotekina 6ff6a4989a Implement at32() util
Works like .at() but uses source location for "exception".
2022-09-26 18:04:15 +03:00
Nekotekina b49a1f27eb Warning fixes 2022-09-17 16:35:02 +03:00
Eladash 2807be7080 SPU: Regression fix after #12648 2022-09-13 20:11:30 +03:00
kd-11 0d9b1654ec asm: Avoid ALU instructions on busy wait cycles 2022-09-09 23:17:27 +03:00
Eladash 28bec8e1bf SPU: Implement custom reservation condition in atomic wait 2022-08-21 15:02:01 +03:00
Nekotekina b6608ad31d vm_native: rewrite win7 workaround 2022-08-15 12:26:17 +03:00
Nekotekina 7bb2d94e53 vm: use sparse files to emulate overcommit memory
Fix shm::map_critical page flags.
2022-08-12 13:59:03 +03:00
Eladash 34bae90820 LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
Megamouse 3d73915358 cellSearch: improve populate_photo_info, read image headers 2022-07-26 17:27:35 +02:00
Megamouse c40439ae6b cellMusic/Decode: implement playlist shuffle and repeat 2022-07-22 08:42:43 +02:00
sguo35 9e57efe82c spu: implement assembly functions for arm64 2022-07-15 12:37:33 +03:00
sguo35 086e12c6ca mac: mmap calls should initialize with r/w page perms
Mac/Arm64 pages should be R/W by default due to 16k page
incompatibility. Without this there will be segfaults due to invalid
permissions.
2022-07-15 12:37:33 +03:00
sguo35 9b19f16698 arm64: add optimized 16byte ld/st for armv8.4a+
16B ldp/stp are atomic on v8.4a+. See Arm Architecture Reference Manual,
"Changes to single-copy atomicity in Armv8.4". Add load/release atomic
impls for this instruction and add detection for 8.4a+ capability.
2022-07-15 12:37:33 +03:00
Eladash ab27ee4cf4 Savestates/RSX: Save NV406E semaphore waiting 2022-07-12 15:15:42 +03:00
Eladash 6211295155 atomic.hpp: Truncation warning fix 2022-07-12 15:15:42 +03:00
Eladash 219e3d61f8 Minor fix in shm::map_critical 2022-07-10 14:19:59 +03:00
Nekotekina 786510a937 Use gettid() on Linux, don't use std:🧵:id
pthread_self() returns a large opaque pointer which is harder to use.
2022-07-10 12:22:28 +03:00
Nekotekina 4b787b22c8 Implement FN (lambda shortener)
Useful for some higher order functions.
Allows to make short lambdas even shorter.
2022-07-08 14:47:41 +03:00
Nekotekina 5c6f5a1610 Cleanse LOG_CONSTINIT macro
Should be unnecessary.
2022-07-08 14:47:41 +03:00
Eladash 4ac88fa8d3 Savestates/RSX: Save drawing context 2022-07-08 12:57:43 +03:00
Eladash 5f8f9e33f1 RSX/Savestates: Replace GCM hack with a proper fix 2022-07-08 12:57:43 +03:00
Eladash b692108f1e Savestates: HLE state saving POC in sys_lwmutex 2022-07-06 19:43:25 +03:00
Elad Ashkenazi fcd297ffb2
Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
Eladash 71e07dc6c7 IdManager.h: Improvements
* Ensure ::PtrSame<T, Derived> is true.
* Allow id_base, id_step and id_count to be of enumeration type.
* Fix potential deadlock in kernel explorer.

idm::select:
* Allow to select multiple inherited object types for idm::select.
* Allow function reference types. (they don't allow access to operator() directly, use deducing std::function constructor instead)
* Ensure ::is_same_ptr<T, object_type> is true.
2022-06-22 17:24:47 +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
Elad Ashkenazi 1738b38536
vm_native.cpp: Use Windows 10 memory mapping API (the correct API) 2022-06-10 14:27:02 +03:00
Nekotekina b0ccd2a8a0 Implement utils::c_page_size (unused)
Query platform memory page size.
2022-06-02 12:56:49 +03:00
Megamouse 88ee62be26
cellAdec: fix uninitialized default size of AVPacketHolder (#12077) 2022-05-25 11:40:51 +02:00