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:
authorMumogg <104529023+Mumogg@users.noreply.github.com>2026-11-23 21:10:20 -0600
committerMumogg <104529023+Mumogg@users.noreply.github.com>2026-11-23 21:10:20 -0600
commitf70ed489f5c9ed138cf766468a2e2fd5b2855f12 (patch)
tree4b9b428f616ae6c4b69d09a83fcab80e6939c85a /runtime/test/xmem_test.cpp
parent8d4dd7a80cbd55f8cbf1a89ef7780d806e04f401 (diff)
xmem_test: the write-combine window's page is written before its view is queried
main's xmem commits a physical page on first touch, so the check added with the view-protection fix has to touch the page first, as the read-write case above it does. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Diffstat (limited to 'runtime/test/xmem_test.cpp')
-rw-r--r--runtime/test/xmem_test.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/test/xmem_test.cpp b/runtime/test/xmem_test.cpp
index f552c5b6e..bf5bd3638 100644
--- a/runtime/test/xmem_test.cpp
+++ b/runtime/test/xmem_test.cpp
@@ -711,6 +711,8 @@ void test_write_combine_window(const PhysicalApi& api) {
711 const bool mapped = api.map(window, 1, &page) == window; 711 const bool mapped = api.map(window, 1, &page) == window;
712 check(mapped, "a page maps into a window reserved with PAGE_WRITECOMBINE"); 712 check(mapped, "a page maps into a window reserved with PAGE_WRITECOMBINE");
713 if (mapped) { 713 if (mapped) {
714 // Physical pages are committed on first touch, so the view is written before it is queried.
715 *static_cast<volatile unsigned char*>(window) = 1;
714 MEMORY_BASIC_INFORMATION info{}; 716 MEMORY_BASIC_INFORMATION info{};
715 VirtualQuery(window, &info, sizeof(info)); 717 VirtualQuery(window, &info, sizeof(info));
716 check(info.State == MEM_COMMIT && info.Protect == PAGE_READWRITE, 718 check(info.State == MEM_COMMIT && info.Protect == PAGE_READWRITE,