From nobody Wed Dec 17 18:15:45 2025 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 585AC18C903 for ; Sat, 11 Jan 2025 00:30:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736555430; cv=none; b=Si0HxeJfMqrirMyHTKyFaMziq8OkMM65VfK1tZMbEf0R5HSRVdRZuS0dSMRN/mPhnHEgHYo8Bn8ostfAW98UdpPMR6In4FLP6v61FZyXoOHn0oElS9uHrL23JBcKVyo5Zv4ZUQFqOcpN5ddL3I0bnpZ+6PF+pGsFzogbDJU8HSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736555430; c=relaxed/simple; bh=Ct3FuonCRgDJp/Ui+bQ/TVeX0BiSNd/ih2pMmElS7V4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gXZYzWl4AbbLHzsDaNIFWH+4C1kOenJl20f+vyCia/JRLgBNCcnkMfR3BPTHO32b1KsZ2odawBdpl6nhB40sWjLgnLgjfIv9uKB/i6vt5OYHw9pbPHY7Dg8POiPOhneZKuV+UY+toc5OYOZ/Atirskn1QW/Ozk7Ar8ZAyL6stjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yPbSM8Ej; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yPbSM8Ej" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2164861e1feso46072935ad.1 for ; Fri, 10 Jan 2025 16:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736555429; x=1737160229; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=y05jSkqCIR81O47S4buDh42roqUgkkPVJYIkUmCWrzY=; b=yPbSM8EjFFKFftkcwWXAmBItUdHbdwNF3ybnL5WhdGG2/71N/SLxYy2exNlx5B29SR goHvdSknV74JdavsCnAVtnxquX77kvOBqgY/cXM8NEDNh+tkorKYI/tmpI5fOKkDgbc9 cG7HDahKJDLC1i6whYU1HZFq+VU8+yVEGjJZCmAiGyQN/AAHSlgH3IOyKlVaYiITIGT8 uhNdRqJOHSxW/KedGxbDoDK0jZKLiuYDkIHNrVWBbFVAS+LUdb771U8q0el6ZOdeuiPC aAVfoKWVyyUbAgRN4Et4VIuqq4x3Qk3FNAR1w47DS9v1yCasEXUzwi5UEWipGSee/zK0 YxVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736555429; x=1737160229; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y05jSkqCIR81O47S4buDh42roqUgkkPVJYIkUmCWrzY=; b=QLNPQTfd3tYE99LYG2Jof8I5EkFkxgEekxLKEM08TqGHYTAqh7JQu8mL2fU8vclFoN 1MGh2oCtrJX4lk3QrGMgGc7uaEAuC3JRtpRHyToQFGxO911Tvuf93t7h0+G7wAwG5/BV 6f939tbeCaPGNWRyz3TnERKYUp3i9P3RDgJ41Jndk1JsnMDYf7JF89mjdQ5/vpl249fY Wgr+WOSD7r7ZZT23GyeKVEqEbEoqnd9aH+ruZ6/vKBye5/2oQB34VvsI9VjqW6hQ+S6h XlZXH8K22b8/jIKPcYm+/xWR/aiiqhD3+Nqr+vIUlxb1SOb7nVUIhtO2pygMXYLIPstv XI0g== X-Forwarded-Encrypted: i=1; AJvYcCUhJtwBv2G+kWz5upg5zOPsbXACbME55SyMvC8j1xW40VsTGHirnfM86OnZy6vguOT8yq74Vx5B3V/YDbA=@vger.kernel.org X-Gm-Message-State: AOJu0YwG7dslSbSEr7ZLmqVtIERg/wC/8LQ7WbCps1tbJJqlXA4uifW9 ZtHsJapNADic/w1Gpi2JaeY3sdLge0cyZO4edZlQGVoI8nsJqRkPXcKm4lUGTXBl8tlLoFdPV6J qlA== X-Google-Smtp-Source: AGHT+IFgrnZzIKEMTRy6t4DPba2tanrxDHSa0a90bgDXxnDvHGsIE64G7RceEr5QZnECylO0tNxGXGphF04= X-Received: from pfbfm22.prod.google.com ([2002:a05:6a00:2f96:b0:725:c96b:b1db]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:c887:b0:1e0:dc7b:4ee9 with SMTP id adf61e73a8af0-1e88cf7ba69mr21582007637.8.1736555428699; Fri, 10 Jan 2025 16:30:28 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 10 Jan 2025 16:29:56 -0800 In-Reply-To: <20250111003004.1235645-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250111003004.1235645-1-seanjc@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20250111003004.1235645-13-seanjc@google.com> Subject: [PATCH v2 12/20] KVM: selftests: Use continue to handle all "pass" scenarios in dirty_log_test From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Xu , Maxim Levitsky , Sean Christopherson Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When verifying pages in dirty_log_test, immediately continue on all "pass" scenarios to make the logic consistent in how it handles pass vs. fail. No functional change intended. Reviewed-by: Maxim Levitsky Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/dirty_log_test.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/s= elftests/kvm/dirty_log_test.c index 8544e8425f9c..d7cf1840bd80 100644 --- a/tools/testing/selftests/kvm/dirty_log_test.c +++ b/tools/testing/selftests/kvm/dirty_log_test.c @@ -510,8 +510,6 @@ static void vm_dirty_log_verify(enum vm_guest_mode mode= , unsigned long *bmap) } =20 if (__test_and_clear_bit_le(page, bmap)) { - bool matched; - nr_dirty_pages++; =20 /* @@ -519,9 +517,10 @@ static void vm_dirty_log_verify(enum vm_guest_mode mod= e, unsigned long *bmap) * the corresponding page should be either the * previous iteration number or the current one. */ - matched =3D (val =3D=3D iteration || val =3D=3D iteration - 1); + if (val =3D=3D iteration || val =3D=3D iteration - 1) + continue; =20 - if (host_log_mode =3D=3D LOG_MODE_DIRTY_RING && !matched) { + if (host_log_mode =3D=3D LOG_MODE_DIRTY_RING) { if (val =3D=3D iteration - 2 && min_iter <=3D iteration - 2) { /* * Short answer: this case is special @@ -567,10 +566,8 @@ static void vm_dirty_log_verify(enum vm_guest_mode mod= e, unsigned long *bmap) } } =20 - TEST_ASSERT(matched, - "Set page %"PRIu64" value %"PRIu64 - " incorrect (iteration=3D%"PRIu64")", - page, val, iteration); + TEST_FAIL("Dirty page %lu value (%lu) !=3D iteration (%lu)", + page, val, iteration); } else { nr_clean_pages++; /* --=20 2.47.1.613.gc27f4b7a9f-goog