Skip to content

fix(libc): reach the application map area end with the guest arena - #652

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Celegans12:fix/guest-arena-app-map-area
Oct 5, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Celegans12:fix/guest-arena-app-map-area

Conversation

@Celegans12

@Celegans12 Celegans12 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What

On Windows the guest arena ends at 0x72_0000_0000, so a fixed direct memory mapping above it throws shared mapping outside the guest arena.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main 53dc19c: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 284/284 tests pass (ctest --output-on-failure)
  • guest_memory gains CheckFixedMappingsReachTheApplicationAreaEnd: a fixed mapping of the last two pages below 0xFC_0000_0000, read through an alias, and a refused one at the end; it fails on main at the range check.
  • PPSA26344 v1.008, past the VideoOut checks that stop it on main: without this change it aborts at that first mapping; with it, it runs on to sceAudioOut2PortCreate: data format 0xc00 is not implemented.
  • Not tested: Linux (CI), console behaviour.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#637 core/libs/prx/libc/src/GuestArena.cpp L211-212

On Windows the guest arena ended at 0x72_0000_0000: boykopovar#231 kept its
448 GiB size after boykopovar#153 had moved its start down to 0x2_0000_0000.
Titles map fixed addresses up to the application map area end,
0xFC_0000_0000 (SCE_KERNEL_APP_MAP_AREA_END_ADDR on the PS4), and a
direct memory mapping above the old end threw "shared mapping outside
the guest arena".

The arena is now reserved up to 0xFC_0000_0000. The out-of-arena
errors name the address and length, and a fixed mapping over a used
arena range says whether it hit a host region. guest_memory maps
direct memory at the last two pages below the end, reads it through
an alias and checks that a mapping at the end is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Celegans12
Celegans12 force-pushed the fix/guest-arena-app-map-area branch from e109bb8 to 5085746 Compare October 5, 2026 15:51
@oneandonlydean
oneandonlydean merged commit 974c3fa into boykopovar:main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants