From 3fe5df474bf268dc87f05991462df52150a7c511 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 4 Apr 2026 22:51:10 +0200 Subject: [PATCH 1/2] PageTableHostMappingTest: Fix alignment for misaligned+hole test Mistakenly, MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE was aligned and MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE_ALIGNED was misaligned. It should be the other way around. These variables are unused due to a separate mistake which is corrected in the next commit. --- Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp b/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp index fcb0071054..c7b93d12fc 100644 --- a/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp +++ b/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp @@ -36,8 +36,8 @@ static constexpr u32 HOLE_MASK_PAGE_TABLE_BASE = 0x00080000; static constexpr u32 HOLE_MASK_PAGE_TABLE_MASK = 0x0002ffff; static constexpr u32 HOLE_MASK_PAGE_TABLE_MASK_WITHOUT_HOLE = 0x0003ffff; -static constexpr u32 MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE = 0x000e0000; -static constexpr u32 MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE_ALIGNED = 0x000d0000; +static constexpr u32 MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE = 0x000d0000; +static constexpr u32 MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE_ALIGNED = 0x000c0000; static constexpr u32 MISALIGNED_HOLE_MASK_PAGE_TABLE_MASK = 0x0002ffff; static constexpr u32 MISALIGNED_HOLE_MASK_PAGE_TABLE_MASK_WITHOUT_HOLE = 0x0003ffff; From 4f0219d08c7a497621b5ab54f4ac730b4fbf5f15 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 4 Apr 2026 22:50:12 +0200 Subject: [PATCH 2/2] PageTableHostMappingTest: Fix copypaste error in misaligned+hole test Because of this mistake, HoleInMaskMisalignedPageTable was testing the same thing as MisalignedPageTable, which wasn't the intent. --- Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp b/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp index c7b93d12fc..2cfb4b8c8f 100644 --- a/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp +++ b/Source/UnitTests/Core/PowerPC/PageTableHostMappingTest.cpp @@ -820,12 +820,12 @@ TEST_F(PageTableHostMappingTest, HoleInMask) // mask, we get the same result as if we just make the base misaligned. TEST_F(PageTableHostMappingTest, HoleInMaskMisalignedPageTable) { - SetSDR(MISALIGNED_PAGE_TABLE_BASE + 0x10000, PowerPC::PAGE_TABLE_MIN_SIZE - 1); + SetSDR(MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE + 0x10000, PowerPC::PAGE_TABLE_MIN_SIZE - 1); AddHostSizedMapping(0x10ad0000, 0x002d0000, 4); ExpectMapped(0x10ad0000, 0x002d0000); - SetSDR(MISALIGNED_PAGE_TABLE_BASE, MISALIGNED_PAGE_TABLE_MASK); + SetSDR(MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE, MISALIGNED_HOLE_MASK_PAGE_TABLE_MASK); ExpectNotMapped(0x10ad0000); @@ -850,7 +850,8 @@ TEST_F(PageTableHostMappingTest, HoleInMaskMisalignedPageTable) ExpectMapped(0x10ad0000, 0x00310000); ExpectMapped(0x10ed0000, 0x00300000); - SetSDR(MISALIGNED_PAGE_TABLE_BASE_ALIGNED, MISALIGNED_PAGE_TABLE_MASK); + SetSDR(MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE_ALIGNED, + MISALIGNED_HOLE_MASK_PAGE_TABLE_MASK_WITHOUT_HOLE); ExpectNotMapped(0x102d0000); ExpectMapped(0x106d0000, 0x002f0000);