From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl2-f43.google.com (mail-dl2-f43.google.com [74.125.229.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BD3441D655 for ; Tue, 22 Sep 2026 18:29:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.229.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790101775; cv=none; b=pQcmj1JoINGdd84YSFiDTrHzSpDdRaq6YmQQEsPHpU5H+qZzpJuDG/gjdAkzQhEv0RA18zhbjZdo0E+hGyqvaupvOZx5xFSVxzik4dDi1eJ0NJQuyh7osg972ck8ino0YAF30F4xNOFMUIXqe2uuk1TQgvLJPl9EvsFSE554C8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790101775; c=relaxed/simple; bh=9SAVA5mG82KIJnNzTrkIkFNNxhz7HJOIVyBGo3z7EM0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YnzZLXeOQxBBGPGnq9SqauG24DTuEVsGL6UAURLxOGaXVOq37ORREWAck5mRbT3X4fFQftyiNU77Mk0LDiWe8FsolNAKP+drq2gV8lGvDp3wZRYKz/cbsGxnMl+O1FwUd+t7g64lh0COwcTwejws0oa7Q3Z0ZTMpfoF9a1fAoEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QKyzHp9E; arc=none smtp.client-ip=74.125.229.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QKyzHp9E" Received: by mail-dl2-f43.google.com with SMTP id a92af1059eb24-1438f55921fso66761c88.1 for ; Tue, 22 Sep 2026 11:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790101773; x=1790706573; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=w4tObarZqWzLfPDYSwGxwQwAXuFMWWhRAhqBOMQynsA=; b=QKyzHp9E0+LMEgyi4nDuk3XEMwN0/OcNrdZSGmxBgs9YSsUW14Lzfl9Ap9jjgq9yAQ o98eJC/OvmsBk4wYic1OGftyBTCC3z1wwolnp6382VazYoIRSizQuWteTWyNaZgvMScP T2HaBpt704z5iXwkkMPSN2Fmfwn+5JS9WPduOsjcSC1nF46Tz5lDzxf2O2mqC0MIqc/+ A5bmpM7hljJ6fd+Pw9ywoiZfJABsNrp4zpwdCHECTwHPqAdm4kYyw84b9BrMpnFH+8Er rU+Lt4iYk4jOyOV0cMsB0dXGxMieGxwzlcWT3rRg4QT4gP7h0UYNvDfZuDNiLFOJvBf7 2lAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790101773; x=1790706573; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=w4tObarZqWzLfPDYSwGxwQwAXuFMWWhRAhqBOMQynsA=; b=oft6IX9xMVSrMWMsZa1MCx2oeOfPDLuBol4x4C4kcMc3DtTgMdun5MuYvo/TFAvuzJ QUqu+kRQDbnBr82IRrYN5JN6ZyGrigtdbtbD5YCK1DsZ9tfCsAHawlT99bqzgDZgCyQp n9oq0hv5TTSIPD5WNDvVK679AsBgNP2N/mx50HIxab3lXWMnglVyi84pJszVz0Ky51oI xZ+0x/ypYYBVcwUZi7o5FZCucneuJ9v6H2Nd5EW+o1lGcsX12dtbBDWZrW/O/XUicTYo +gheQBAvexhliGx5FzcHIO05Ma2DHRn3A4FsZ895O/7fdyLbKwgAkmly3syhxUC7Y790 F2eg== X-Forwarded-Encrypted: i=1; AKwUvBxHO9ceKlxTDdfFCjYLUuQTCzrV3YAS69RVENFrSpu3wONSJRURLZL4/3APQZm/EdOdihBZZU+pxqMUUUg=@vger.kernel.org X-Gm-Message-State: AFuF++krM0r8gbaXP9d8JpCihMl5fR5twJYXj4Ie8zLiqxRZbbmLdgbM kwQYLohes445ADMJSrAIOhe88EuKa6U1AxMIZVH1FdPCeXyPksN6IXGR X-Gm-Gg: AYBFou25yAW5Pq002CXTs0Az05DixgTsC75HMs1zYWCd4pzIOsfUYG68jC7HJXWnFw4 2MfyCNjYgy0/JUmw2a6zmVaom3UUa2m7iepo/q7XRA8xSak/S4N5MDJOZjOMkddz48aqJOhiW+B kGS0yHvfdK3BFFlVpt5BFR2L+W7YLTIh9VBmJMpWj8i5VS93mA80Ouy80HxWneGQOkslNRlxuO8 1gDF/5Px8/rFftV/Y2UnP+iTZ8I4FI3tz3ejIecC/9yQ1IGj3uyry64NpYLAk/4aES4MvLEo5Ny gSQxJQfotaOy1UQFpeG203kpsRTDGbCqwxJRdZDcZcsjwxc7X8W1EJ2mVVMaW4I1AhyF1qLjZJa G9Ip9SQGdmaZxRLFt2NhBw5BRDG/RpDMs24SOONLIehtBsIiRReAqjydaAyX/Dm8Yj1okYmTyaI VxoOd4rdiMC35Vhqxo/C/2WIs/DClyATPP8REQaLtoQ2B7clIpDC8I3gb7SKDV+g4dCCMF4wA06 qJnN54eLc2hVY0a2tybC3h+eaprDHp2gRQJhs75Puh5Gtuf0jLhhfUgWQxG X-Received: by 2002:a05:7301:2421:b0:33c:e8f:5701 with SMTP id 5a478bee46e88-33e8e1b3d3amr121483eec.34.1790101769713; Tue, 22 Sep 2026 11:29:29 -0700 (PDT) Received: from pve-server.rlab ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33e939fdabcsm154315eec.3.2026.09.22.11.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 11:29:29 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: kvm@vger.kernel.org Cc: Sean Christopherson , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Christophe Leroy , Anushree Mathur , Venkat Rao Bagalkote , Harsh Prateek Bora , Madhavan Srinivasan , Shrikanth Hegde , linux-kernel@vger.kernel.org, "Ritesh Harjani (IBM)" Subject: [PATCH v5 3/9] KVM: selftests: Don't limit LE dirty-bitmap bitops to s390x Date: Tue, 22 Sep 2026 23:58:47 +0530 Message-Id: <09b1330bb7ef56920ff451af15f98ea468899209.1790101179.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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") Signed-off-by: Ritesh Harjani (IBM) --- tools/testing/selftests/kvm/dirty_log_test.c | 12 ++++-------- 1 file 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 -- 2.39.5