summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorRitesh Harjani (IBM) <ritesh.list@gmail.com>2026-10-06 15:58:35 +0530
committerSean Christopherson <seanjc@google.com>2026-10-13 12:02:35 -0700
commitab1d40006720a4857ab6f0d3cbc43a3be62e42dd (patch)
tree2871f334a96ce019e18d735fc8485537aade11b6 /tools/testing
parent1e59e5a3bdbed560bb2acec3a117f193a646332a (diff)
KVM: selftests: Don't limit LE dirty-bitmap bitops to s390x
dirty_log_test already has BITOP_LE_SWIZZLE helpers, but they were compiled in only for s390x, so every other big-endian host used native test_bit(). The test fails on big-endian powerpc because it treated dirty host pages as clean (because of the endianness issue) w/o the fix the test fails with: Clear page 1 value (1) >= iteration (1) Fixes: a049a377164c ("KVM: selftests: Enable dirty_log_test on s390x") Tested-by: Anushree Mathur <anushree.mathur@linux.ibm.com> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Gautam Menghani <gautam@linux.ibm.com> Tested-by: Gautam Menghani <gautam@linux.ibm.com> Acked-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/63c900860b5f7e49cfa7258602e94b58b3de73b3.1791280439.git.ritesh.list@gmail.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/kvm/dirty_log_test.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c
index af5eb0334a74..8189eaac713c 100644
--- a/tools/testing/selftests/kvm/dirty_log_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_test.c
@@ -44,8 +44,11 @@
#define TEST_MIN_WRITES_PER_ITERATION 0x100
/* Dirty bitmaps are always little endian, so we need to swap on big endian */
-#if defined(__s390x__)
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+#else
+# define BITOP_LE_SWIZZLE 0
+#endif
# define test_bit_le(nr, addr) \
test_bit((nr) ^ BITOP_LE_SWIZZLE, addr)
# define __set_bit_le(nr, addr) \
@@ -56,13 +59,6 @@
__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, addr)
# define __test_and_clear_bit_le(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, addr)
-#else
-# define test_bit_le test_bit
-# define __set_bit_le __set_bit
-# define __clear_bit_le __clear_bit
-# define __test_and_set_bit_le __test_and_set_bit
-# define __test_and_clear_bit_le __test_and_clear_bit
-#endif
#define TEST_DIRTY_RING_COUNT 65536