From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 DA59A2114 for ; Sat, 11 Jan 2025 00:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736555411; cv=none; b=F19qniiYWDdth1GCoPIm89X0z/WDmG7tXnUM4xg/WbNVSHqpaqxpib2YMBt+FaPhhvs+713HZyDfESisg7i07qN0dEcKoZaAv/5dO+1U2bXZMzYyMZRHHlO7VNcT4ZADNpQz5k6sA3rvbkPYzfMHG8yHns5lKu4yaEMKNjIPTNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736555411; c=relaxed/simple; bh=IPV+UZ6l0RkxJEPJs1XadT7uny3C590ErYEO6CK/OjM=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=SgerCdQ8MmRdhNwr8NXJtfpq7Qw6cbXGDxys/vT7D3pF7jJzzSzhfYO61N7orYQzuz9AZSTix64CkJcvzn70aepuZneYH3M91o7XDUoQHhZqq5zStfdKwuYV/1a9HsKxXmkVSRKxnY2KvMFppRU85BP5oqMgP8xRZx3lvf0SGSI= 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=dI6u+okf; arc=none smtp.client-ip=209.85.216.73 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="dI6u+okf" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2f5538a2356so4534326a91.2 for ; Fri, 10 Jan 2025 16:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736555409; x=1737160209; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=Lx0fb42bvSma/AKcurOI/fK9QHvPRBt0kFsOecEfyxM=; b=dI6u+okfPJJK/UpNUn6fMjM7ASyI6JQj+GqY/cXQ2BmmQPQrDK1ISldVGWKSOcZmHs 4fHJiCa2L5IQydc4PHHFRT67IAruP3B6vQPSYVJoPvLCIStgtydRoo8VzI/zT6GudxTi ezt199JPmeQCePp/A8PJkjNM8SMxE1vP6498eUE3L+IYN908a/2FNcDYSqizHOA2ByW4 /3srgrHQtsrrrM5vBqu2bibqCBY0jyDp5WCom9Uiu3nyvSenf1NTXuwofP87p+B/z0gg BvZZk++v2ybS5A107Lzlz0DAYGqOxChMavzatw6GFoWDOIA/MlNqlKdvTmGfR6rz70Wt vwSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736555409; x=1737160209; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lx0fb42bvSma/AKcurOI/fK9QHvPRBt0kFsOecEfyxM=; b=V9qi8EM9rq8wE0nGKo01oSZtXXKiy+EEVF6AQaisnmJDlTaODDG4JhD8DmaddbxkUP 4Jqza+kBQ3u2aIlHz/5e0tDdc2QdunZgqvbewdwp70w9+5ysAJ4VBXvjM+3QOgtsenxT /C6dnyZkVf0OFdfKis1YxfJtwEO0ejgKeS7Mkvl44EMJGq0/yfcJuImcNm6/lV1n8dFl 7voXDCO0+zWFnOoJcz5P7hsopBNFV4dnpNy/XrCHpry8UeqUauqIf/8RvYrtvl6UKgkD ps15O2EojDjpYKnsunxL+yAqyyZU9/33RzfvSG6ls8jFPHtK6MOweLNhyTlSHojKqFzo SFuA== X-Forwarded-Encrypted: i=1; AJvYcCW8yqd0E85DLkCO2fDOFOAWMj2a5E2sYjOiCjTpoK7Y4dNgh3jRj2ClD1stHnL/Hr0CDNbowVnfTiDqlmA=@vger.kernel.org X-Gm-Message-State: AOJu0YyT66bppTQ4BrywzkUMGvWDAxIff9KfPPOENJ9R7bk+YaX2ZcO9 5YKAr+s0RsZAMNGcXPoZ5O7RPNI0nMrxabBJ2Ux4QjenrQWOoJFHFCmNjJet9IEhOJ76mh6JnXE Y0g== X-Google-Smtp-Source: AGHT+IHmMP2GI45Z4VWglkCcNFjFL3DBqH9/xjgygy1SQQkiPZffieaQDVjMLrE5PetUKqK6umgxgfdoego= X-Received: from pjwx11.prod.google.com ([2002:a17:90a:c2cb:b0:2ef:9ef2:8790]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:258c:b0:2ee:5691:774e with SMTP id 98e67ed59e1d1-2f548ea6252mr19356658a91.2.1736555409230; Fri, 10 Jan 2025 16:30:09 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 10 Jan 2025 16:29:44 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20250111003004.1235645-1-seanjc@google.com> Subject: [PATCH v2 00/20] KVM: selftests: Fixes and cleanups for 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-Type: text/plain; charset="UTF-8" Fix a variety of flaws and false failures/passes in dirty_log_test, and drop code/behavior that adds complexity while adding little-to-no benefit. Lots of details in the changelogs, and a partial list of complaints[1] in Maxim's original thread[2]. [1] https://lore.kernel.org/all/Z1vR25ylN5m_DRSy@google.com [2] https://lore.kernel.org/all/20241211193706.469817-1-mlevitsk@redhat.com v2: - Collect reviews. [Maxim] - Expand a few changelogs to be more explicit about the effects. [Maxim] - Print the number of writes from each iteration. [Maxim] - Fix goofs in the last patch (stale message and changelog). [Maxim] v1: https://lore.kernel.org/all/20241214010721.2356923-1-seanjc@google.com Maxim Levitsky (2): KVM: selftests: Support multiple write retires in dirty_log_test KVM: selftests: Limit dirty_log_test's s390x workaround to s390x Sean Christopherson (18): KVM: selftests: Sync dirty_log_test iteration to guest *before* resuming KVM: selftests: Drop signal/kick from dirty ring testcase KVM: selftests: Drop stale srandom() initialization from dirty_log_test KVM: selftests: Precisely track number of dirty/clear pages for each iteration KVM: selftests: Read per-page value into local var when verifying dirty_log_test KVM: selftests: Continuously reap dirty ring while vCPU is running KVM: selftests: Honor "stop" request in dirty ring test KVM: selftests: Keep dirty_log_test vCPU in guest until it needs to stop KVM: selftests: Post to sem_vcpu_stop if and only if vcpu_stop is true KVM: selftests: Use continue to handle all "pass" scenarios in dirty_log_test KVM: selftests: Print (previous) last_page on dirty page value mismatch KVM: selftests: Collect *all* dirty entries in each dirty_log_test iteration KVM: sefltests: Verify value of dirty_log_test last page isn't bogus KVM: selftests: Ensure guest writes min number of pages in dirty_log_test KVM: selftests: Tighten checks around prev iter's last dirty page in ring KVM: selftests: Set per-iteration variables at the start of each iteration KVM: selftests: Fix an off-by-one in the number of dirty_log_test iterations KVM: selftests: Allow running a single iteration of dirty_log_test tools/testing/selftests/kvm/dirty_log_test.c | 521 +++++++++---------- 1 file changed, 246 insertions(+), 275 deletions(-) base-commit: 10485c4bc3caad3e93a6a4e99003e8ffffcd826a -- 2.47.1.613.gc27f4b7a9f-goog