Rosetta 2 panics with an EmulateForward error when a page fault occurs during AVX masked load or store instructions. This breaks games like God of War that rely on VMASKMOVPS and VMASKMOVPD near page boundaries.
Work around this on macOS by replacing both instructions with scalar branches and basic SSE/AVX operations.
On Linux and macOS, GetHostPath walks the host path looking for a
case-insensitive match. When a component of the guest path is a regular
file (e.g. stat("/data/file.txt/x") or "/data/file.txt/"), it built a
directory_iterator on that file without an error_code, which threw
std::filesystem::filesystem_error (ENOTDIR). Nothing catches it, so
open, stat, mkdir, rmdir, rename and sceKernelCheckReachability
terminated the emulator.
Use the error_code overload, like HostFsBackend::ResolveCaseInsensitive
already does. The search then finds no match and GetHostPath returns the
plain host path, which is what Windows always does.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Implement advisory file locking with LOCK_SH, LOCK_EX, and LOCK_UN
- Support LOCK_NB returning POSIX_EWOULDBLOCK
- Synchronize locks per host path across open file handles
- Handle lock upgrade and downgrade on existing handles
- Automatically release held locks on close
- Add sceKernelFlock wrapper and register NID YDg-SQj66AQ
* texture_cache: Hash GC baselines through the backing memory
* buffer_cache: Mark only the faulting range CPU modified on a write fault
* core: Remove the comment on HashBackingMemory
* core: Hash unbacked pages as zeros like CopySparseMemory
* texture_cache: Hash GC baselines through the backing page table
* Allow file type identification for '/addcont' path
* Fix indentation and formatting in file_system.cpp
* Fix indentation for clang-format
* Enhance addon handling and entitlement validation
Refactor app_content.cpp to support multiple addon paths and entitlement checks.
* Refactor LoadLicenses to use string_view
* shader_recompiler: Handle HW_ID.SE_ID reads
Support SE_ID and its one-bit slices as virtual shader engine zero.
Keep other hardware-register reads unsupported and use the normal
destination writer without modifying SCC.
* shader_recompiler: Extract S_GETREG_B32 handler
Move the instruction handler out of EmitFlowControl to match the other
instructions. Preserve the supported fields and generated IR.
* Add PT_SCE_MODULE_PARAM case in module.cpp
Added handling for PT_SCE_MODULE_PARAM in module processing.
* Add GetModuleParam method and module_param_virtual_addr
sceAppContentTemporaryDataMount2 clears the folder when the game mounts
it with FORMAT (#5426). Clearing it on every boot also cleared it when a
game relaunches itself with sceSystemServiceLoadExec, which starts a new
emulator process: Yakuza 0 writes /temp0/es_sd.sdt, LoadExecs into an
arcade game and expects the file when it comes back (#4739).
posix_unlink never checked that the path exists. For a missing file it
opened the host path, the open failed, IOFile::Unlink returned early
because the file was not open, and the call still returned 0. On the
console unlink(2) fails with ENOENT, so sceKernelUnlink should return
0x80020002. Check the path with MntPoints::Exists first, as
posix_truncate already does.
Also check for a null path before calling strlen on it, and report
EFAULT like the other path functions in this file instead of crashing.
posix_ftruncate returned 0 for a negative length and for a descriptor
opened with O_RDONLY, because the result of SetSize was ignored, and it
returned EROFS for a directory. On the console ftruncate(2) fails with
EINVAL when the length is negative (checked before the descriptor) and
when the descriptor is not open for writing, which includes directories,
so sceKernelFtruncate should return 0x80020016 in those cases.
Check the length first like posix_truncate does, return EINVAL for
directories and read-only handles, and report EIO when SetSize fails.
write, writev and pwritev on a file opened with O_RDONLY returned -1
from HostFile::Write without setting errno, so callers saw a stale errno
and sceKernelWrite returned 0x80020000 (or whatever was left in errno).
writev and pwritev also added the -1 of every buffer to the total. On
the console write(2) fails with EBADF when the descriptor is not open for
writing, so sceKernelWrite should return 0x80020009.
Add File::IsReadOnly next to IsWriteOnly and check it the same way read,
readv and preadv already check IsWriteOnly.
posix_mkdir used fs::create_directories, so mkdir("/data/a/b") with no
/data/a returned 0 and created both directories. On the console mkdir(2)
only creates the last component and fails with ENOENT when the parent is
missing, so sceKernelMkdir should return 0x80020002. Use
fs::create_directory and report ENOENT in that case.
Also check for a null path before logging it and calling strlen on it,
and report EFAULT like posix_rmdir does, instead of crashing.
Added:
- Global FIFO for CE tasks across graphics submissions.
Updated:
- CE/DE waits to yield through the scheduler.
- CE counter lifetime and GPU-idle tracking.
- Cleanup of pending and nested tasks during shutdown.
Removed:
- CE task ownership and counter resets tied to individual DCBs.
@raphaelthegreat requested global CE task ownership and a separate
change shared by the Horizon fixes.
* texture_cache: don't copy stale CPU-dirty image contents in ExpandImage
When the source image is CPU-dirty its contents are stale; copying them after RefreshImage overwrites the fresh upload. Only copy (and inherit GpuModified) when the source holds GPU-written data.
* Use HasGpuValidData()
* shader_recompiler: Accept S_SLEEP as a scheduling hint
Treat the finite scalar scheduling delay as a no-op during functional
translation instead of rejecting shaders that contain it.
* shader_recompiler: Warn when ignoring S_SLEEP
Keep the scheduling hint visible in the log, matching other unsupported
flow-control hints.
FillSockInfo always left recv_queue_length at 0. Knowledge is Power
(CUSA08013) polls sceNetGetSockInfo on its PlayLink UDP sockets and
never calls recv while the queue reads empty, so incoming datagrams
from the companion app were never read. Fill it from FIONREAD for
host sockets.