From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1580A4C91 for ; Wed, 18 Dec 2024 00:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734480112; cv=none; b=Ljysdr2fN0hjUMVO0whwRhtIkOYGD7m62Oj+J8UbZH7GWOdf7r1LgSk87RnyiiIMu8QeqjDIyK2bGti60cDp6lEqv6/t5WIu8xRg27/bAa/MLyofpciCSAZC+gqwGI428K51BhsWfFxPTnbrRFp9xsf6oX+9bG6Y9rdlvjqyCH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734480112; c=relaxed/simple; bh=RPV8NHETpwZrch0i9HHKPge5aSu8SMdjDOs4Cf7tn0s=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=gcRQDxVFDsMt5F5oVlzmBSCiO8BSHmH5PJiw83B4Id9i6uaynCYQmDRK2PSzz4De4gR5FKFYfhA0UAeNXtbGaEY1he01kByS0LEMkYoiUUzvkTFeT+3SjXKHgcfAelafHDWB9gX+WSmZkvKWP29/GfbDzZyVzivNNrRq1nnQ1NE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=X0+yxISe; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X0+yxISe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734480110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sy0SEHtU7ymBdc8kQss3/cZ8WyWlAJFyiuBskKegsD8=; b=X0+yxISe609yR8Nk2WafiXA+TeDqUKQlLjItvAyHhxOXvdsaRtoxX+f1sG7yvQZTI04+iP etwTTsd0A7Ec/U1ilCqF3+smv9zs1tZqaolY42ZlvPbV+eLM09U4wQb4MCivL+k7L04RMf w4VycmTWr3rWUK+fw2yNayff2EXqQyU= Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-304-rgkQR5p4M7Gp1sAKUUAgUg-1; Tue, 17 Dec 2024 19:01:48 -0500 X-MC-Unique: rgkQR5p4M7Gp1sAKUUAgUg-1 X-Mimecast-MFC-AGG-ID: rgkQR5p4M7Gp1sAKUUAgUg Received: by mail-il1-f200.google.com with SMTP id e9e14a558f8ab-3abe7375ba6so118889065ab.3 for ; Tue, 17 Dec 2024 16:01:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734480108; x=1735084908; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Sy0SEHtU7ymBdc8kQss3/cZ8WyWlAJFyiuBskKegsD8=; b=kjD4B96X68VARkNB6hxSBOvFZMCvADiOsgFrF+BqQxHxMnAi5M8M3fP2N543ynKA3Z oiSNunYOKnjoUB8QKp1aRxGdbJ3Bzd7jkfvzKGsrwOoGIYQP+CHu2J8icTlsfytCTF5P KKj6lfMN6R+ZcwTvnzvEJ2OBlN0NCUfNv0d+0b91p0FId4S+9lrifj4gJ6ZGzxfURaNI pG6AC+++Q7nt8YdK1RjovQci8+B+uTLjrwrh0adWw06GbTG5/Oii2FtFdszEHVPbMFet Vo/pt7lTN+BN0JKQtD99e+Em9CR0AV/EWNlNu+byga92D5Vq7ufKyZOE8IppavGvnI3/ cmSg== X-Forwarded-Encrypted: i=1; AJvYcCU6aq2WUYbPWbgikZkhH38l3530tsAhKwcO+rfLZ+jy7WnoAs80tp7/r2g01WuWtUXv7xqrERSrjlUehtU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9dUJ3UJU778yLUQF/qJ5TJfynpLdXSPvn3I+fRw6pC7cshYnP H/PNgu5ov4F2fKkZDs2lr+b3sz74K1Bx/J4xnXqLiJ4bzEVyUBvBWg61PtxR0/ILGpCERBelRGx mtyFiYT0/gZydSkxHPqkEe1d0aTcVusy8eSmEvrfgzv2EyAhtCvgw2tZkJQCl/Q== X-Gm-Gg: ASbGncuUs500mMMGYv3DjDPQbLFU7S1bh5ofrp7fOV9xFUS0M7a2pn7yiDfTrUQiG3q 6pLEd7/YmDJ4XxwEwd5FRjeJMSM7v6svQxl8GUy4In3vLzNi42EgCBDW+LhYaAJrw1/Q42CPayE 3IVCb1VyiYzLofP4R6GQcWi0WYFLsYh3kNZiR3iSzT9wwIF3XYA6+OsszAPv813IrmgIC/Ts5Jc QHqqT1w7MHyVnEbrLZP3oDMQFTn+Lm1yBOXPXSdzt+kD/4/IVEneoTC X-Received: by 2002:a05:6e02:154e:b0:3a7:e0c0:5f27 with SMTP id e9e14a558f8ab-3bdc003ea1bmr8673775ab.2.1734480108083; Tue, 17 Dec 2024 16:01:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqtSauAxLKaUv+ErPKawDuRLvkDraDsEBvKGe7S9rN3lJjO5tHsFC+fcSFJpA5qzRD6QhHCQ== X-Received: by 2002:a05:6e02:154e:b0:3a7:e0c0:5f27 with SMTP id e9e14a558f8ab-3bdc003ea1bmr8673535ab.2.1734480107802; Tue, 17 Dec 2024 16:01:47 -0800 (PST) Received: from starship ([2607:fea8:fc01:8d8d:6adb:55ff:feaa:b156]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e5e378c1f9sm1895487173.134.2024.12.17.16.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 16:01:47 -0800 (PST) Message-ID: <57871d28eeda31c34ce10f60b55fe6cc9c137748.camel@redhat.com> Subject: Re: [PATCH 13/20] KVM: selftests: Print (previous) last_page on dirty page value mismatch From: Maxim Levitsky To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Xu Date: Tue, 17 Dec 2024 19:01:46 -0500 In-Reply-To: <20241214010721.2356923-14-seanjc@google.com> References: <20241214010721.2356923-1-seanjc@google.com> <20241214010721.2356923-14-seanjc@google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit On Fri, 2024-12-13 at 17:07 -0800, Sean Christopherson wrote: > 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. > > 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/selftests/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 mode, unsigned long *bmap) > } > } > > - TEST_FAIL("Dirty page %lu value (%lu) != iteration (%lu)", > - page, val, iteration); > + TEST_FAIL("Dirty page %lu value (%lu) != iteration (%lu) " > + "(last = %lu, prev_last = %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 mode, unsigned long *bmap) > * value "iteration-1". > */ > TEST_ASSERT(val <= iteration, > - "Clear page %"PRIu64" value %"PRIu64 > - " incorrect (iteration=%"PRIu64")", > - page, val, iteration); > + "Clear page %lu value (%lu) > iteration (%lu) " > + "(last = %lu, prev_last = %lu)", > + page, val, iteration, dirty_ring_last_page, > + dirty_ring_prev_iteration_last_page); > if (val == iteration) { > /* > * This page is _just_ modified; it Reviewed-by: Maxim Levitsky