From nobody Thu Dec 18 05:23:36 2025 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 16BAF18F2DF for ; Sat, 11 Jan 2025 00:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736555432; cv=none; b=CvtTTQNUszxYACUmhcAPbCVZy/cc6zMWbYCWLQqRH+1SxfNGPB86tVQWwm01KvOOS8CNAlO8XQuJb1zswz2FIie/PgIeGTcnY9k3Do9hPZKZH87N+D+1hwmREEQpTPRJsFPazl6Il3ava06Fc6FQnJLZlhwqumnI8C45S+9pt4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736555432; c=relaxed/simple; bh=X7hrJAn5Xd5/ffe52AsOh35kq+1hLy36dj+3TszD2jM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=UykIxvKebHNUnBTLLJkF5X9gnuFssOkdmA0+FUwjpOba5bF4go0IBLPF5UOYxWatbZ/3k6Y4jGMJ74qXUaXpDW+vw17Qq3UB1CZ5nHNiBk97RRU8DdXiiw65+L1ATukIKsNz/siEuSOuD7+GIcIomuxinUmp/WY8PS9rO2mylpU= 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=F3kdqhOo; arc=none smtp.client-ip=209.85.216.74 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="F3kdqhOo" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ee5668e09bso4738662a91.3 for ; Fri, 10 Jan 2025 16:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736555430; x=1737160230; 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=xyN0UMRkk6rC6WIB3fcMIoPE8NE4GF50oCJ4Jr6Xg0Y=; b=F3kdqhOoJPU1ILmLGSbMSfJU6GKiBddLNkQpIBuzga/DrIPukoiBEIaeTFN2/cjOsO EdKislkUdig9PE0zDi2pRd4CnJ7rYm9dCJfc7R0yYKiQm9oJ1z4EWGgt3tnaKwv+v7B3 V/78b2IAY8WvIc5zsKHegWhggH/WbjEJui6F/9HZZBTi8bzNESyVcSfCuYUy9qwKryto nYxyd11M9BmPuo9S8hiqJkmCSKf/F5SqZp/qowI8gmE4Sq9/IT69v7pGJcY3kwwLpXRk E0Iq73mnxe05vw7XXIxKVzF6xZOvX2s4fDLN5r+SqZXvBVdxW8szYAsw+dKgTkUKxJVL yi1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736555430; x=1737160230; 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=xyN0UMRkk6rC6WIB3fcMIoPE8NE4GF50oCJ4Jr6Xg0Y=; b=ApoXySHtgqld/uPBb3Gci8UsMkPYqjebQzPBicOEhsAPyvOYvq2q4ZXDpjIS45Sulp DM2UJxsmzf9pXb+rYeT31XxAcrXfQfiCIU/6e+l1F+c2EUQ5p67DCJP3cY/IxqpzahG4 AvTj3tHgvLNR/QHKmm0luz9ePmj0f5Tp6T1rX4G5ap/qVWmwJNWNmQBCEzpkDyEn+e6P Z58IOgtwTQnlUjERvM0sDizGu05yjx5ljUTeOZj26lO8TwvSBMChUTAr/0K+7t57PXl9 51chUB1uQHLe6Co8gv3EsjgVGpcYcxvVky8tzf7C18jXA5k43Dx2BLTSql25pZHdog7J jhKg== X-Forwarded-Encrypted: i=1; AJvYcCXpHsZHmHq+RFF8w/feL56ijIvJ2cxh4WK3rT3siQWNXHkNg2PsbQLIpcZwTbdQiMxstSasIL0eupzT8M4=@vger.kernel.org X-Gm-Message-State: AOJu0YyNsg9kknBRmNr1gG3BesJQE5Gbu4ZRUlm7Rg8b6rNf7tV/6kLI NAPLl7r96n8vMuhOGvPU3r9hMTj2a3ZUthlyYMxrXSfh1usjUZA8Z/ueI3CObJnnyAtA9/qtVaC xoQ== X-Google-Smtp-Source: AGHT+IEVKgEyyMYviyDeVcIm5o6jXTSkBhgMiqMrJzFk4QIbXfpDD6AKxEzcxV0qnKVdo1toVPZDgB8gkB8= X-Received: from pjbqi14.prod.google.com ([2002:a17:90b:274e:b0:2ef:d283:5089]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2509:b0:2f6:be57:49cd with SMTP id 98e67ed59e1d1-2f6be574ac9mr253754a91.25.1736555430491; Fri, 10 Jan 2025 16:30:30 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 10 Jan 2025 16:29:57 -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-14-seanjc@google.com> Subject: [PATCH v2 13/20] KVM: selftests: Print (previous) last_page on dirty page value mismatch 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" Print out the last dirty pages from the current and previous iteration on verification failures. In many cases, bugs (especially test bugs) occur on the edges, i.e. on or near the last pages, and being able to correlate failures with the last pages can aid in debug. Reviewed-by: Maxim Levitsky Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/dirty_log_test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/s= elftests/kvm/dirty_log_test.c index d7cf1840bd80..fe8cc7f77e22 100644 --- a/tools/testing/selftests/kvm/dirty_log_test.c +++ b/tools/testing/selftests/kvm/dirty_log_test.c @@ -566,8 +566,10 @@ static void vm_dirty_log_verify(enum vm_guest_mode mod= e, unsigned long *bmap) } } =20 - TEST_FAIL("Dirty page %lu value (%lu) !=3D iteration (%lu)", - page, val, iteration); + TEST_FAIL("Dirty page %lu value (%lu) !=3D iteration (%lu) " + "(last =3D %lu, prev_last =3D %lu)", + page, val, iteration, dirty_ring_last_page, + dirty_ring_prev_iteration_last_page); } else { nr_clean_pages++; /* @@ -590,9 +592,10 @@ static void vm_dirty_log_verify(enum vm_guest_mode mod= e, unsigned long *bmap) * value "iteration-1". */ TEST_ASSERT(val <=3D iteration, - "Clear page %"PRIu64" value %"PRIu64 - " incorrect (iteration=3D%"PRIu64")", - page, val, iteration); + "Clear page %lu value (%lu) > iteration (%lu) " + "(last =3D %lu, prev_last =3D %lu)", + page, val, iteration, dirty_ring_last_page, + dirty_ring_prev_iteration_last_page); if (val =3D=3D iteration) { /* * This page is _just_ modified; it --=20 2.47.1.613.gc27f4b7a9f-goog