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:
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 991388c7f..58143ae49 100644
--- a/runtime/test/xmem_test.cpp
+++ b/runtime/test/xmem_test.cpp
@@ -741,7 +741,19 @@ void test_copy_page_mappings_cpu_view(const PhysicalApi& api) {
741 check(readable(other) && page_holds(other, 0x7300u), 741 check(readable(other) && page_holds(other, 0x7300u),
742 "a GPU-only source page unmapped there is looked up at its CPU range"); 742 "a GPU-only source page unmapped there is looked up at its CPU range");
743 743
744 // A null source unmaps both ranges. 744 // 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
745 // GPU-only page alone (the console's CopyPageMappingsBatchX edits only that range's page table).
746 check(copy(gpu + 2 * kPage64k, pool + kPage64k, 1, false), "a copy onto a GPU-only page whose CPU page is the title's");
747 check(readable(gpu + 2 * kPage64k) && page_holds(gpu + 2 * kPage64k, 0x7301u),
748 "the GPU-only page shows the copied pool page");
749 check(readable(cpu + 2 * kPage64k) && page_holds(cpu + 2 * kPage64k, 0x7300u),
750 "the title's own mapping at the paired CPU page is kept, not replaced by the copy");
751 check(copy(gpu + 2 * kPage64k, nullptr, 1, false), "a null source unmaps a GPU-only page whose CPU page is the title's");
752 check(!readable(gpu + 2 * kPage64k), "the GPU-only page is unmapped");
753 check(readable(cpu + 2 * kPage64k) && page_holds(cpu + 2 * kPage64k, 0x7300u),
754 "the title's own mapping at the paired CPU page survives the unmap");
755
756 // A null source unmaps both ranges where the CPU pages are the copy's own.
745 check(copy(gpu, nullptr, kPool, false), "a null source unmaps the GPU-only range"); 757 check(copy(gpu, nullptr, kPool, false), "a null source unmaps the GPU-only range");
746 check(!readable(gpu) && !readable(cpu) && !readable(cpu + kPage64k), "the paired CPU range is unmapped with it"); 758 check(!readable(gpu) && !readable(cpu) && !readable(cpu + kPage64k), "the paired CPU range is unmapped with it");
747 759