upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/xmem_test.cpp
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 09:32:25 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 09:32:25 -0500
commit63c4978d2aa89cf896f8e42f450665a0d25aab74 (patch)
tree1f36cc0bd35c1c058ae2bf6ac693532b06ed9e02 /runtime/test/xmem_test.cpp
parent071ec8449caf234f3255cdc083afd9db2eda399b (diff)
parent28fc0262d2957412cecfbfa8dd679b8e9e7dbf53 (diff)
Merge #1972 from kurrutako: a slot-31 copy leaves the title's own mappings at the paired CPU range (RT-SLOT31-CPU-TWIN-TITLE-PAGES)
Head 28fc0262d. Closed by its author as incomplete; merged because world run 41 had it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/xmem_test.cpp')
-rw-r--r--runtime/test/xmem_test.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/runtime/test/xmem_test.cpp b/runtime/test/xmem_test.cpp
index f78f09c77..adc24cca3 100644
--- a/runtime/test/xmem_test.cpp
+++ b/runtime/test/xmem_test.cpp
@@ -814,7 +814,19 @@ void test_copy_page_mappings_cpu_view(const PhysicalApi& api) {
814 check(readable(other) && page_holds(other, 0x7300u), 814 check(readable(other) && page_holds(other, 0x7300u),
815 "a GPU-only source page unmapped there is looked up at its CPU range"); 815 "a GPU-only source page unmapped there is looked up at its CPU range");
816 816
817 // A null source unmaps both ranges. 817 // A CPU page the title mapped itself is the title's: a copy onto its GPU-only page, or an unmap of it, changes the
818 // GPU-only page alone (the console's CopyPageMappingsBatchX edits only that range's page table).
819 check(copy(gpu + 2 * kPage64k, pool + kPage64k, 1, false), "a copy onto a GPU-only page whose CPU page is the title's");
820 check(readable(gpu + 2 * kPage64k) && page_holds(gpu + 2 * kPage64k, 0x7301u),
821 "the GPU-only page shows the copied pool page");
822 check(readable(cpu + 2 * kPage64k) && page_holds(cpu + 2 * kPage64k, 0x7300u),
823 "the title's own mapping at the paired CPU page is kept, not replaced by the copy");
824 check(copy(gpu + 2 * kPage64k, nullptr, 1, false), "a null source unmaps a GPU-only page whose CPU page is the title's");
825 check(!readable(gpu + 2 * kPage64k), "the GPU-only page is unmapped");
826 check(readable(cpu + 2 * kPage64k) && page_holds(cpu + 2 * kPage64k, 0x7300u),
827 "the title's own mapping at the paired CPU page survives the unmap");
828
829 // A null source unmaps both ranges where the CPU pages are the copy's own.
818 check(copy(gpu, nullptr, kPool, false), "a null source unmaps the GPU-only range"); 830 check(copy(gpu, nullptr, kPool, false), "a null source unmaps the GPU-only range");
819 check(!readable(gpu) && !readable(cpu) && !readable(cpu + kPage64k), "the paired CPU range is unmapped with it"); 831 check(!readable(gpu) && !readable(cpu) && !readable(cpu + kPage64k), "the paired CPU range is unmapped with it");
820 832