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 <noreply@anthropic.com>
This commit is contained in:
Chad
2026-10-05 15:59:59 -05:00
parent 164fcf7a05
commit 710369f3d3
+2 -2
View File
@@ -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<std::uint64_t*>(address);
volatile std::uint64_t& At(std::uint64_t address) {
return *reinterpret_cast<volatile std::uint64_t*>(address);
}
void TestAmm() {