From 710369f3d31ee69362b67afb1521fc60d4397ea1 Mon Sep 17 00:00:00 2001 From: Chad Date: Mon, 5 Oct 2026 15:59:59 -0500 Subject: [PATCH] test(libs): access aliased AMM mappings through volatile references The AMM test writes through one mapping of a physical page and reads it through another. The two addresses are distinct to the compiler, so GCC 13 at -O2 moved the read ahead of the write and the Linux CI check saw the old value. The test's At helper now returns a volatile reference. Co-Authored-By: Claude Opus 5.5 --- core/libs/tests/GuestAmpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/libs/tests/GuestAmpr.cpp b/core/libs/tests/GuestAmpr.cpp index c7efa4cea..5734aa209 100644 --- a/core/libs/tests/GuestAmpr.cpp +++ b/core/libs/tests/GuestAmpr.cpp @@ -535,8 +535,8 @@ constexpr std::int32_t cpuReadWrite = 0x03; constexpr std::int32_t cpuGpuReadWrite = 0x33; constexpr std::int32_t amprReadWrite = 0xC0; -std::uint64_t& At(std::uint64_t address) { - return *reinterpret_cast(address); +volatile std::uint64_t& At(std::uint64_t address) { + return *reinterpret_cast(address); } void TestAmm() {