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:
authorGustavo Kissel <kisselgustavo@gmail.com>2026-11-23 14:43:57 -0300
committerGustavo Kissel <kisselgustavo@gmail.com>2026-11-23 14:43:57 -0300
commit4a7bfd5c4d86eb4cf6e63ff8fcbb508729d8a948 (patch)
tree32ecba2f5b564ca18cffadfc467a2b49c05d05af /runtime/test/xmem_test.cpp
parent5ba2a7f95fbd6db34a2a3efcbb9602f02b20c917 (diff)
xmem: map a run as one view per host placeholder it spans
After a partial unmap or remap, a run of consecutive pages can lie across several host placeholders, and MEM_REPLACE_PLACEHOLDER needs the view to fill one placeholder exactly, so mapping the whole run again failed with ERROR_INVALID_PARAMETER. map_view now maps one view per placeholder the run spans; a fresh window is still one view. Found and fixed by dotaku22 in review; xmem_test gains their check (the whole run maps again over a split range).
Diffstat (limited to 'runtime/test/xmem_test.cpp')
-rw-r--r--runtime/test/xmem_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/test/xmem_test.cpp b/runtime/test/xmem_test.cpp
index b5df76766..a52886c16 100644
--- a/runtime/test/xmem_test.cpp
+++ b/runtime/test/xmem_test.cpp
@@ -385,6 +385,11 @@ void test_physical_pages(const PhysicalApi& api) {
385 385
386 check(api.map(window, kPages, nullptr) == window, "XMemMapPhysicalPages with no page array unmaps"); 386 check(api.map(window, kPages, nullptr) == window, "XMemMapPhysicalPages with no page array unmaps");
387 check(reserved_only(window) && reserved_only(window + 3 * kPage64k), "unmapped pages are reserved again"); 387 check(reserved_only(window) && reserved_only(window + 3 * kPage64k), "unmapped pages are reserved again");
388 // The split above left the range as several host placeholders; the whole run maps again over them.
389 check(api.map(window, kPages, pages) == window && page_holds(window, 0x1000u) &&
390 page_holds(window + 3 * kPage64k, 0x4000u),
391 "a run maps again over a range an earlier partial unmap split");
392 check(api.map(window, kPages, nullptr) == window && reserved_only(window), "and unmaps again");
388 393
389 // Remap in reverse order into the other window: each page keeps its contents. 394 // Remap in reverse order into the other window: each page keeps its contents.
390 uint64_t reversed[kPages]; 395 uint64_t reversed[kPages];