fix(libkernel): query non-readable live mappings #1929

Merged
MarcZX10 merged 4 commits from upstream-pr/1929 into main 2026-10-10 04:42:51 +00:00
MarcZX10 commented 2026-10-09 00:19:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T00:19:18Z.


Closes #1894.

What

This PR carries the live-mapping extent fix from #1731 (the original commit author is preserved), adds support for querying live ranges whose registry protection is PROT_NONE, and includes the direct-mmap partial-unmap regression test contributed in #2267. The test commit retains Saranxzi as its author. sceKernelVirtualQuery must report current mapped extents after partial unmaps and still find non-readable mappings; GPU consumers continue using the existing readable-only lease.

Without the full-range snapshot, guest_ampr_markers fails when querying AMPR protection on a mapped range. The regression checks a PROT_NONE mapping and verifies the registered extent and protection. A debug assertion makes explicit that the full-range lease is address-ordered before the coalescing scan relies on that invariant.

Tested

Current head e06c459534fec70b5738d55392794fa963421024 is rebased linearly onto upstream main at e51d4e1f21280da4529dc7fe3a3d50d7d7dbc3ec. The complete source diff remains limited to four files.

  • Linux x86-64, GCC 12.2, Release: built guest_memory_tests; guest_memory passed (1/1) on this head, exercising flexible-range splits, PROT_NONE, and direct mmap after partial unmap.
  • Windows 11 Pro 25H2, RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0, Release: guest_memory passed and full CTest passed (510/510) on pre-rebase commit 099b8cf0 cherry-picked onto main d70b8998 (report); this predates the additional direct-mmap test. Saranxzi separately reported the direct-mmap regression passing on Windows and Linux on #2267 head 8073bda, not on this combined head.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD pass.
  • An earlier fork Build stopped at the unrelated missing SPIRV-Headers include in agc_shader_fusion_tests; #2099 fixed that dependency. Eligibility, Conventions, report, and all three relinker jobs pass on this head. The automated PR workflow skipped the full Linux and Windows Build jobs; an authorized collaborator must start Build for those under #2113.
  • No console hardware was available.

Checklist

  • Based on current main; overlap with #2267 is disclosed, and its direct-mmap regression test is included here with original author attribution; coordination with its author is pending
  • One topic: report live guest mapping extents after partial unmaps and for non-readable ranges
  • No code comments except technical debt comments; no silent stubs added
  • No notes, investigation files or images added to the repository
  • No new third-party code
  • Generic behavior, not title-specific
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4794363444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T00:19:18Z. --- Closes #1894. ### What This PR carries the live-mapping extent fix from #1731 (the original commit author is preserved), adds support for querying live ranges whose registry protection is `PROT_NONE`, and includes the direct-`mmap` partial-unmap regression test contributed in #2267. The test commit retains Saranxzi as its author. `sceKernelVirtualQuery` must report current mapped extents after partial unmaps and still find non-readable mappings; GPU consumers continue using the existing readable-only lease. Without the full-range snapshot, `guest_ampr_markers` fails when querying AMPR protection on a mapped range. The regression checks a `PROT_NONE` mapping and verifies the registered extent and protection. A debug assertion makes explicit that the full-range lease is address-ordered before the coalescing scan relies on that invariant. ### Tested Current head `e06c459534fec70b5738d55392794fa963421024` is rebased linearly onto upstream `main` at `e51d4e1f21280da4529dc7fe3a3d50d7d7dbc3ec`. The complete source diff remains limited to four files. - Linux x86-64, GCC 12.2, Release: built `guest_memory_tests`; `guest_memory` passed (1/1) on this head, exercising flexible-range splits, `PROT_NONE`, and direct `mmap` after partial unmap. - Windows 11 Pro 25H2, RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0, Release: `guest_memory` passed and full CTest passed (510/510) on pre-rebase commit `099b8cf0` cherry-picked onto `main` `d70b8998` ([report](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6080846366)); this predates the additional direct-`mmap` test. Saranxzi separately reported the direct-`mmap` regression passing on Windows and Linux on #2267 head `8073bda`, not on this combined head. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main...HEAD` pass. - An earlier fork Build stopped at the unrelated missing SPIRV-Headers include in `agc_shader_fusion_tests`; #2099 fixed that dependency. Eligibility, Conventions, report, and all three relinker jobs pass on this head. The automated PR workflow skipped the full Linux and Windows Build jobs; an authorized collaborator must start Build for those under #2113. - No console hardware was available. ### Checklist - [x] Based on current `main`; overlap with #2267 is disclosed, and its direct-`mmap` regression test is included here with original author attribution; coordination with its author is pending - [x] One topic: report live guest mapping extents after partial unmaps and for non-readable ranges - [x] No code comments except technical debt comments; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] No new third-party code - [x] Generic behavior, not title-specific - [x] Depends on: none - [x] AI-assisted: yes
MarcZX10 commented 2026-10-09 00:19:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T00:19:29Z.


The PR is based on current upstream main (f145139676a48306681d3a4d5fabf83938759daf), and the focused Linux guest_memory test plus conventions pass locally. No upstream checks are reported for head 493000d5787aff60a8fe6a892cb81da1e79c1e13. CONTRIBUTING says fork workflows marked action_required need maintainer approval; could an authorized maintainer approve Build and Conventions for this head?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6071653204 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6071653204). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T00:19:29Z. --- The PR is based on current upstream `main` (`f145139676a48306681d3a4d5fabf83938759daf`), and the focused Linux `guest_memory` test plus conventions pass locally. No upstream checks are reported for head `493000d5787aff60a8fe6a892cb81da1e79c1e13`. CONTRIBUTING says fork workflows marked `action_required` need maintainer approval; could an authorized maintainer approve Build and Conventions for this head?
MarcZX10 commented 2026-10-09 00:34:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T00:34:50Z.


#1929 now stacks on the exact current #1731 commit 1a301c48a74f879ac3136745056edd8b7bf04403 and contains the distinct follow-up for mapped, non-readable ranges. Fork Build 37868880231 passed on the identical source tree: Linux 497/497, Windows 488/488, and relinker CTests on Ubuntu, Windows and macOS. Exact-head Build 37870858453 is queued. Upstream still reports no checks; under CONTRIBUTING's fork workflow policy, could an authorized maintainer approve Build and Conventions for this head?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6071821695 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6071821695). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T00:34:50Z. --- #1929 now stacks on the exact current #1731 commit `1a301c48a74f879ac3136745056edd8b7bf04403` and contains the distinct follow-up for mapped, non-readable ranges. Fork Build [37868880231](https://github.com/MarcZX100/AnyPS5/actions/runs/37868880231) passed on the identical source tree: Linux 497/497, Windows 488/488, and relinker CTests on Ubuntu, Windows and macOS. Exact-head Build [37870858453](https://github.com/MarcZX100/AnyPS5/actions/runs/37870858453) is queued. Upstream still reports no checks; under CONTRIBUTING's fork workflow policy, could an authorized maintainer approve Build and Conventions for this head?
klosixgaming-arch commented 2026-10-09 00:37:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-09T00:37:43Z.

Review: APPROVED


Good fix for a real bug: after a partial munmap, sceKernelVirtualQuery was reporting the full allocation range instead of the live sub-range. The new logic coalesces contiguous sub-ranges (same allocationAddress, adjacent addresses) in both directions, so a query inside a fragmented allocation reports the correct live extent and a query in the unmapped hole returns EACCES. The test CheckVirtualQueryAfterPartialUnmap covers the merged range, the hole, the findNext flag, and the post-unmap state — exactly the regression this fixes.

Minor: the bidirectional merge walks the lease and assumes it is ordered by address; if that invariant is ever relaxed, the coalescing would silently under-merge. An assert (or a one-line note) that the lease is address-ordered would make the assumption explicit.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5464472116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#pullrequestreview-5464472116). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-09T00:37:43Z. **Review:** APPROVED --- Good fix for a real bug: after a partial `munmap`, `sceKernelVirtualQuery` was reporting the full allocation range instead of the live sub-range. The new logic coalesces contiguous sub-ranges (same `allocationAddress`, adjacent addresses) in both directions, so a query inside a fragmented allocation reports the correct live extent and a query in the unmapped hole returns EACCES. The test `CheckVirtualQueryAfterPartialUnmap` covers the merged range, the hole, the `findNext` flag, and the post-unmap state — exactly the regression this fixes. Minor: the bidirectional merge walks the lease and assumes it is ordered by address; if that invariant is ever relaxed, the coalescing would silently under-merge. An assert (or a one-line note) that the lease is address-ordered would make the assumption explicit. Written with AI assistance.
MarcZX10 commented 2026-10-09 00:53:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T00:53:33Z.


The lease is address-ordered by construction: the registry stores ranges in std::map keyed by address, and both lease functions append them in map iteration order. The updated all-range snapshot preserves the same ordering, so the adjacent-range merge walks stable address order.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072021179 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6072021179). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T00:53:33Z. --- The lease is address-ordered by construction: the registry stores ranges in `std::map` keyed by address, and both lease functions append them in map iteration order. The updated all-range snapshot preserves the same ordering, so the adjacent-range merge walks stable address order.
MarcZX10 commented 2026-10-09 01:01:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T01:01:53Z.


@klosixgaming-arch #1929 now stacks on the exact current #1731 commit and its source tree is unchanged from the fully green fork Build 37868880231. Linux CTest 497/497, Windows CTest 488/488, and all relinker jobs passed. Exact-head Build 37870858453 is running; please re-review the current head after it completes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072108776 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6072108776). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T01:01:53Z. --- @klosixgaming-arch #1929 now stacks on the exact current #1731 commit and its source tree is unchanged from the fully green fork Build [37868880231](https://github.com/MarcZX100/AnyPS5/actions/runs/37868880231). Linux CTest 497/497, Windows CTest 488/488, and all relinker jobs passed. Exact-head Build [37870858453](https://github.com/MarcZX100/AnyPS5/actions/runs/37870858453) is running; please re-review the current head after it completes.
MarcZX10 commented 2026-10-09 01:43:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T01:43:18Z.


The exact current heads are #1731 1a301c48 and this PR ee68f671. Upstream Actions created Build and Conventions runs for both fork heads, but all are action_required; this token has pull-only access on boykopovar/AnyPS5, so I cannot approve those workflows. The same source tree was already validated in our fork Build (Linux CTest 497/497, Windows 488/488, relinker CTests on Ubuntu/Windows/macOS), and #1731 has been approved after full review. Could an authorized maintainer approve the upstream fork workflows? The exact-head runs are Build 37870860630 and Conventions 37870893265 for this PR; #1731 Build 37870628828 and Conventions 37870628839.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072538614 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6072538614). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T01:43:18Z. --- The exact current heads are `#1731` 1a301c48 and this PR ee68f671. Upstream Actions created Build and Conventions runs for both fork heads, but all are `action_required`; this token has pull-only access on boykopovar/AnyPS5, so I cannot approve those workflows. The same source tree was already validated in our fork Build (Linux CTest 497/497, Windows 488/488, relinker CTests on Ubuntu/Windows/macOS), and #1731 has been approved after full review. Could an authorized maintainer approve the upstream fork workflows? The exact-head runs are Build 37870860630 and Conventions 37870893265 for this PR; #1731 Build 37870628828 and Conventions 37870628839.
MarcZX10 commented 2026-10-09 08:07:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:07:40Z.


Updated head: rebased the #1731 shared patch plus this follow-up onto current upstream main 25f10087; pushed 4ff734c0. On Linux x86_64/GCC 12.2 Release, rebuilt both focused test binaries; guest_memory and guest_ampr_markers pass (2/2). Conventions and diff checks pass. Fork Build 37902960354 is running on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077028518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6077028518). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T08:07:40Z. --- Updated head: rebased the #1731 shared patch plus this follow-up onto current upstream main 25f10087; pushed `4ff734c0`. On Linux x86_64/GCC 12.2 Release, rebuilt both focused test binaries; `guest_memory` and `guest_ampr_markers` pass (2/2). Conventions and diff checks pass. Fork Build [37902960354](https://github.com/MarcZX100/AnyPS5/actions/runs/37902960354) is running on this head.
MarcZX10 commented 2026-10-09 08:20:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:20:54Z.


Rebased the fully reviewed three-commit diff onto current upstream main 6cc0503d and pushed head 8a222b65. The focused Linux guest_memory and guest_ampr_markers tests both pass (2/2); conventions and git diff --check pass. Fork Build 37904356054 is running on the exact new head. The updated PR description records the previous head’s unrelated missing SPIRV-Headers build dependency and points to #2093.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077219810 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6077219810). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T08:20:54Z. --- Rebased the fully reviewed three-commit diff onto current upstream `main` `6cc0503d` and pushed head `8a222b65`. The focused Linux `guest_memory` and `guest_ampr_markers` tests both pass (2/2); conventions and `git diff --check` pass. Fork Build [37904356054](https://github.com/MarcZX100/AnyPS5/actions/runs/37904356054) is running on the exact new head. The updated PR description records the previous head’s unrelated missing `SPIRV-Headers` build dependency and points to #2093.
MarcZX10 commented 2026-10-09 08:28:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:28:21Z.


Build 37904356054 completed: Linux and Windows fail only while compiling agc_shader_fusion_tests, with VulkanTestDevice.hpp missing spirv/unified1/spirv.hpp; the Ubuntu, Windows and macOS relinker jobs pass. I checked both job logs. This matches #2093’s missing SPIRV-Headers target dependency, and the PR description now records that result. The focused tests on this head pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077324191 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6077324191). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T08:28:21Z. --- Build [37904356054](https://github.com/MarcZX100/AnyPS5/actions/runs/37904356054) completed: Linux and Windows fail only while compiling `agc_shader_fusion_tests`, with `VulkanTestDevice.hpp` missing `spirv/unified1/spirv.hpp`; the Ubuntu, Windows and macOS relinker jobs pass. I checked both job logs. This matches #2093’s missing `SPIRV-Headers` target dependency, and the PR description now records that result. The focused tests on this head pass.
MarcZX10 commented 2026-10-09 09:21:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T09:21:53Z.


Updated to current upstream main d9484c71; the four-file diff is unchanged. The PR body now fills Depends on: none, and exact-head Conventions passes. The focused Linux tests passed on the immediately preceding head, whose source diff is identical. The earlier full Build failed at the missing SPIRV-Headers include; #2099 is now in this base and fixes that dependency. Could an upstream collaborator run the full Build for current PR head 103e97ff under the #2113 policy?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078114439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6078114439). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T09:21:53Z. --- Updated to current upstream `main` `d9484c71`; the four-file diff is unchanged. The PR body now fills `Depends on: none`, and exact-head Conventions passes. The focused Linux tests passed on the immediately preceding head, whose source diff is identical. The earlier full Build failed at the missing SPIRV-Headers include; #2099 is now in this base and fixes that dependency. Could an upstream collaborator run the full Build for current PR head `103e97ff` under the #2113 policy?
MarcZX10 commented 2026-10-09 09:25:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T09:25:24Z.


@klosixgaming-arch Your review observation about address ordering is now explicit in this head via the std::is_sorted assertion; the lease is populated from the address-keyed registry map. The PR is rebased to current main and Conventions passes. Please re-review head 103e97ff when convenient. The older full Build hit the header dependency fixed in #2099; an upstream collaborator can now run the manual full Build for this PR under #2113.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078168557 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6078168557). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T09:25:24Z. --- @klosixgaming-arch Your review observation about address ordering is now explicit in this head via the `std::is_sorted` assertion; the lease is populated from the address-keyed registry map. The PR is rebased to current `main` and Conventions passes. Please re-review head `103e97ff` when convenient. The older full Build hit the header dependency fixed in #2099; an upstream collaborator can now run the manual full Build for this PR under #2113.
rmz-24 commented 2026-10-09 12:26:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T12:26:06Z.


Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build plus libs. 099b8cf0 cherry-picked onto current main d70b8998 (applies cleanly).

  • guest_memory passes.
  • Full ctest: 510/510.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080846366 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6080846366). Originally posted by [rmz-24](https://github.com/rmz-24) on 2026-10-09T12:26:06Z. --- Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, full build plus `libs`. 099b8cf0 cherry-picked onto current `main` d70b8998 (applies cleanly). - `guest_memory` passes. - Full ctest: 510/510. AI-assisted: yes
MarcZX10 commented 2026-10-09 12:37:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T12:37:19Z.


Thanks for the Windows report. It tests the exact PR commit 099b8cf0 cherry-picked onto current main d70b8998; the full Windows CTest (510/510) passes, so that closes the Windows validation gap for this source. The upstream PR head still has only Conventions; Linux and the relinker matrix are not yet recorded on this exact head. Could an authorized collaborator run Build and the reviewer recheck the updated address-order assertion?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081030950 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6081030950). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T12:37:19Z. --- Thanks for the Windows report. It tests the exact PR commit `099b8cf0` cherry-picked onto current main `d70b8998`; the full Windows CTest (510/510) passes, so that closes the Windows validation gap for this source. The upstream PR head still has only Conventions; Linux and the relinker matrix are not yet recorded on this exact head. Could an authorized collaborator run Build and the reviewer recheck the updated address-order assertion?
MarcZX10 commented 2026-10-09 19:08:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T19:08:44Z.


Rebased the existing PR linearly onto current main (ae3d5f95) at head 83983e3c. The full diff remains the same four files, including the address-order assertion requested in review. On this head, Linux guest_memory_tests builds and guest_memory passes (1/1); local and GitHub Conventions pass. The prior Windows report is preserved in the description and labeled as pre-rebase evidence.\n\nCould a collaborator with write access run the required upstream Build and relinker matrix on this current PR head under #2113?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087495300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6087495300). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T19:08:44Z. --- Rebased the existing PR linearly onto current `main` (`ae3d5f95`) at head `83983e3c`. The full diff remains the same four files, including the address-order assertion requested in review. On this head, Linux `guest_memory_tests` builds and `guest_memory` passes (1/1); local and GitHub Conventions pass. The prior Windows report is preserved in the description and labeled as pre-rebase evidence.\n\nCould a collaborator with write access run the required upstream Build and relinker matrix on this current PR head under #2113?
MarcZX10 commented 2026-10-09 19:55:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T19:55:10Z.


Updated head and validation

I rebased the existing branch linearly onto upstream main at 8b393b6e and pushed head 14d150b5. The complete diff remains the same four files, including the reviewer-requested lease-order assertion. On this head, Linux guest_memory_tests builds and guest_memory passes (1/1); local Conventions and git diff --check pass. The Windows 510/510 result remains labeled as pre-rebase evidence in the description.

Could the reviewer recheck the assertion on this current head, and could a collaborator with write access run Actions → Build for PR #1929? The required upstream Linux/Windows and relinker matrix has not run for this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088214692 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6088214692). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T19:55:10Z. --- ### Updated head and validation I rebased the existing branch linearly onto upstream `main` at `8b393b6e` and pushed head `14d150b5`. The complete diff remains the same four files, including the reviewer-requested lease-order assertion. On this head, Linux `guest_memory_tests` builds and `guest_memory` passes (1/1); local Conventions and `git diff --check` pass. The Windows 510/510 result remains labeled as pre-rebase evidence in the description. Could the reviewer recheck the assertion on this current head, and could a collaborator with write access run Actions → Build for PR #1929? The required upstream Linux/Windows and relinker matrix has not run for this head.
github-actions[bot] commented 2026-10-09 22:06:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:06:32Z.


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
#1324 core/libs/prx/libc/include/GuestAllocations.hpp L38
core/libs/prx/libc/src/GuestAllocations.cpp L436
#1360 core/libs/prx/libc/include/GuestAllocations.hpp L38
core/libs/prx/libc/src/GuestAllocations.cpp L436
#1803 core/libs/tests/GuestMemory.cpp L1082-1084
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090044927 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6090044927). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T22:06:32Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #1324 | `core/libs/prx/libc/include/GuestAllocations.hpp` [L38](https://github.com/boykopovar/AnyPS5/blob/80d539abcbd0f90a7b6e64f7ab4868556671f241/core/libs/prx/libc/include/GuestAllocations.hpp#L38)<br>`core/libs/prx/libc/src/GuestAllocations.cpp` [L436](https://github.com/boykopovar/AnyPS5/blob/80d539abcbd0f90a7b6e64f7ab4868556671f241/core/libs/prx/libc/src/GuestAllocations.cpp#L436) | | | | #1360 | `core/libs/prx/libc/include/GuestAllocations.hpp` [L38](https://github.com/boykopovar/AnyPS5/blob/80d539abcbd0f90a7b6e64f7ab4868556671f241/core/libs/prx/libc/include/GuestAllocations.hpp#L38)<br>`core/libs/prx/libc/src/GuestAllocations.cpp` [L436](https://github.com/boykopovar/AnyPS5/blob/80d539abcbd0f90a7b6e64f7ab4868556671f241/core/libs/prx/libc/src/GuestAllocations.cpp#L436) | | | | #1803 | `core/libs/tests/GuestMemory.cpp` [L1082-1084](https://github.com/boykopovar/AnyPS5/blob/80d539abcbd0f90a7b6e64f7ab4868556671f241/core/libs/tests/GuestMemory.cpp#L1082-L1084) | | |
MarcZX10 commented 2026-10-09 22:08:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T22:08:06Z.


The overlap scan flagged #2267. I reviewed both diffs: the sceKernelVirtualQuery bound change (allocationAddress/allocationBytes to live range address/bytes) is shared. This PR additionally acquires non-readable ranges and tests mprotect/unmap-split flexible mappings; #2267 contributes a direct mmap partial-unmap regression. I posted a coordination note there; no dependency is implied, but please resolve the shared implementation and preserve the direct-mmap test contribution before merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090063977 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6090063977). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T22:08:06Z. --- The overlap scan flagged #2267. I reviewed both diffs: the `sceKernelVirtualQuery` bound change (`allocationAddress`/`allocationBytes` to live range `address`/`bytes`) is shared. This PR additionally acquires non-readable ranges and tests mprotect/unmap-split flexible mappings; #2267 contributes a direct `mmap` partial-unmap regression. I posted a coordination note there; no dependency is implied, but please resolve the shared implementation and preserve the direct-mmap test contribution before merging.
MarcZX10 commented 2026-10-09 22:15:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T22:15:04Z.


I rebased the existing branch onto current main (e51d4e1f) and carried over the direct-mmap partial-unmap regression from #2267 in commit e06c4595, retaining Saranxzi as the commit author. The combined guest_memory test now covers flexible-range splits, non-readable mappings, and a direct mmap hole/find-next query. Linux Release build and CTest pass (1/1); conventions and diff checks pass. The Windows results from the earlier heads remain labeled as such, and this exact combined head still needs the collaborator-only upstream Build/relinker matrix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090146742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6090146742). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T22:15:04Z. --- I rebased the existing branch onto current `main` (`e51d4e1f`) and carried over the direct-`mmap` partial-unmap regression from #2267 in commit `e06c4595`, retaining Saranxzi as the commit author. The combined `guest_memory` test now covers flexible-range splits, non-readable mappings, and a direct `mmap` hole/find-next query. Linux Release build and CTest pass (1/1); conventions and diff checks pass. The Windows results from the earlier heads remain labeled as such, and this exact combined head still needs the collaborator-only upstream Build/relinker matrix.
MarcZX10 commented 2026-10-09 22:35:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T22:35:29Z.


The latest overlap scan also flags #1324 and #1360 in GuestAllocations.hpp/.cpp. I reviewed those diffs against this PR; the shared files hold separate APIs and behavior:

Change Purpose
#1929 GuestAllocationsAcquireAll_nid_postfix includes non-readable live ranges so sceKernelVirtualQuery can report PROT_NONE mappings.
#1324 / #1360 GuestAllocationsAcquireRange_nid_no_patch and bounded mapping updates/history optimize AGC import lookup and cache validation. #1360 explicitly depends on #1324.

I found no duplicate behavior or dependency between these changes. The additions can coexist; the overlap is at the header/implementation files and may need a small insertion-hunk resolution when branches are combined. The separate direct-mmap test from #2267 is already preserved here with Saranxzi's authorship.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090399511 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1929#issuecomment-6090399511). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T22:35:29Z. --- The latest overlap scan also flags #1324 and #1360 in `GuestAllocations.hpp/.cpp`. I reviewed those diffs against this PR; the shared files hold separate APIs and behavior: | Change | Purpose | |---|---| | #1929 | `GuestAllocationsAcquireAll_nid_postfix` includes non-readable live ranges so `sceKernelVirtualQuery` can report `PROT_NONE` mappings. | | #1324 / #1360 | `GuestAllocationsAcquireRange_nid_no_patch` and bounded mapping updates/history optimize AGC import lookup and cache validation. #1360 explicitly depends on #1324. | I found no duplicate behavior or dependency between these changes. The additions can coexist; the overlap is at the header/implementation files and may need a small insertion-hunk resolution when branches are combined. The separate direct-`mmap` test from #2267 is already preserved here with Saranxzi's authorship.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1929
No description provided.