From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (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 811041A01C3 for ; Sat, 14 Dec 2024 01:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734138471; cv=none; b=Wskm0EpomYIfDG82B+A060xqWyOWfOovfNs1EXAF2bYmzLKJeIb4CwGqMO/CBjqD1akpokO0YaokdtmZsjGiSBzmLxnNQMqH9co5+p3rMyAjMt3mK1FsYxG9JFy72OdNB5Xg61F1ughp75EkfynrkBL1sFO6bbhQY4mxl64slD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734138471; c=relaxed/simple; bh=9MuurmYA9iq2LDQ2mxAkARGTen0azUhe64tjUM5enDU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Z/oyhLrsXL32U/vvOis88ZEWe2BtWgqJTnANNqHm6+FRyfS+nBIEofp7EV0k+E65+swpQ2v1qL+1VJtQRQFllirHW/H44ohfg9D7OpzTeUKszl3RB1FXq/xHkO4wt51xFZ/BWksVuP7c3YRwlkdVReuaJaI35Ewck3xN03r/rS4= 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=bij5tzJK; arc=none smtp.client-ip=209.85.215.201 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="bij5tzJK" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-7e9fb5352dfso2335797a12.3 for ; Fri, 13 Dec 2024 17:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734138470; x=1734743270; 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=aODg1HUrgqSkB9GJzL0iLaYYCcyPgozuZpHxFrW0940=; b=bij5tzJKP93JCUpE4eH2M7jy00dkTbHT5R/1v1wRhqrGSIfDDzBJXkLFuG4P/rjvya lZRn35KdNUK5dIQg1YlE2Ibegg+07TWeNOdT7z2FgnCr7nF4YPg6TMDMIk3pbBBGRqeo mhEZr/0qhEmktZy52Rx0PDnJ03kGkWfebvhNbpVzTZazO7wXjjKybheDVu/zGx8xjQgX hC3Hix2hPXRnfvdj3yNuhMqMjH4y6sdckgCQYwiqKb1+VDPzFp4U3SNnurczT9JGgW5B vBqe3Hx8Z+c9dv3VPBCp7gkWDZdUCIwJprLEJ5rnmbkddgLKACQRzgt6k08fhPuqIA44 A++Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734138470; x=1734743270; 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=aODg1HUrgqSkB9GJzL0iLaYYCcyPgozuZpHxFrW0940=; b=DkJt3Vh3wKwfZwWWs7zHYmExMLhTsEN2DXw8m3D3VJ1w+jGGEfRCkXktc7OQwNjyGN eDkcN0gZrRNTOSqYagMhJphiU9eS/eTJQ/sQe/TPiJb118IOhyQvb+r9gycyxwvGJrp6 fFf0MzWlVJ2ctQ3syyZW2C3rVG5JjDoazmxZakkGEh0I8+Yhlea+V5gHDzMfKugNnNh7 JZh/QY+5Wcoq3RegD8LbekKcGTrl6pF303UdZDSkJiTVFVudCS2NxBvLEWYLHw67LQeP PLxqS1+7rMOBjfKwFQjCRyunqIKcWnNvQCWuuZYcFwCoSpuErDn+pABGvW9pK9vhiLmN 0pIQ== X-Forwarded-Encrypted: i=1; AJvYcCW6nS/3Zq6uCckDfbEqdnWH1DMRJTQTo2Uev4T3i1mH47bNqo0Vb2tTDUZ8JwCw0YQ+ErZynorAYL8GceA=@vger.kernel.org X-Gm-Message-State: AOJu0YxUbz/i4KI5D7YPhcRDc3yZngn4JXUYzZckg7ewEFRUotmjONzS djSFR0G40ty0bfGhlZKR0u++JeTgZ4vMIZYEoLq6UhwrWlc9K2aEqTYF0+Fz+cI0DEpmsk0rBW/ Cpw== X-Google-Smtp-Source: AGHT+IEVD/Y7FXciDQf4D6/qqct1VpWHqA1Sl9Mi4Dpk2L8jDoPr27DKPwgTnmxBz1qbfJxMcCuqPjOJvVg= X-Received: from pjbsy3.prod.google.com ([2002:a17:90b:2d03:b0:2ef:8d43:14d8]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:d44d:b0:2ee:7870:8835 with SMTP id 98e67ed59e1d1-2f2901b548dmr7699775a91.33.1734138470050; Fri, 13 Dec 2024 17:07:50 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 13 Dec 2024 17:07:16 -0800 In-Reply-To: <20241214010721.2356923-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: <20241214010721.2356923-1-seanjc@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241214010721.2356923-16-seanjc@google.com> Subject: [PATCH 15/20] KVM: sefltests: Verify value of dirty_log_test last page isn't bogus From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Xu , Maxim Levitsky , Sean Christopherson Content-Type: text/plain; charset="UTF-8" Add a sanity check that a completely garbage value wasn't written to the last dirty page in the ring, e.g. that it doesn't contain the *next* iteration's value. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/dirty_log_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c index 3a4e411353d7..500257b712e3 100644 --- a/tools/testing/selftests/kvm/dirty_log_test.c +++ b/tools/testing/selftests/kvm/dirty_log_test.c @@ -514,8 +514,9 @@ static void vm_dirty_log_verify(enum vm_guest_mode mode, unsigned long **bmap) * last page's iteration), as the value to be * written may be cached in a CPU register. */ - if (page == dirty_ring_last_page || - page == dirty_ring_prev_iteration_last_page) + if ((page == dirty_ring_last_page || + page == dirty_ring_prev_iteration_last_page) && + val < iteration) continue; } else if (!val && iteration == 1 && bmap0_dirty) { /* -- 2.47.1.613.gc27f4b7a9f-goog