[PATCH 4/4] test: selftest: mmu: skip mirroring tests when not supported
Ahmad Fatoum
a.fatoum at barebox.org
Mon Mar 2 05:47:36 PST 2026
PowerPC e500 uses large CAM-style TLB entries that can't do arbitrary
virtual-to-physical remapping. When arch_remap_range returns -ENOSYS
for the mirroring case, skip the 6 mirroring subtests instead of
counting them as failures.
Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
test/self/mmu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/test/self/mmu.c b/test/self/mmu.c
index f5a09d76131e..1dd42db7e9c1 100644
--- a/test/self/mmu.c
+++ b/test/self/mmu.c
@@ -107,6 +107,10 @@ static void test_remap(void)
expect_success(ret, "asserting no mirror before remap");
ret = arch_remap_range(mirror, buffer_phys, TEST_BUFFER_SIZE, MAP_UNCACHED);
+ if (ret == -ENOSYS) {
+ skipped_tests += 6;
+ goto skip_mirroring;
+ }
expect_success(ret, "remapping with mirroring");
for (i = 0; i < TEST_BUFFER_SIZE; i += sizeof(u32)) {
@@ -150,6 +154,8 @@ static void test_remap(void)
expect_success(ret, "asserting mirroring after remap (virt += 4K)");
+skip_mirroring:
+
ret = remap_range(buffer, TEST_BUFFER_SIZE, MAP_DEFAULT);
expect_success(ret, "remapping buffer with default attrs");
memtest(buffer, TEST_BUFFER_SIZE, "newly cached buffer");
--
2.47.3
More information about the barebox
mailing list