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 451B51DE4C4 for ; Fri, 17 Jan 2025 23:42:06 +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=1737157327; cv=none; b=YGoGn8fuv+ZXpl5syvbgVXpjfmLcjmsQeDZBT8KFTBMPEJQ7JmYWn3Y7EceyRWfVerxqT8aHk2uhJyGFaTqRtRFSMM/y29FOTVuKQ3KyZIYM9TS1pJVE3g6S80qMo1db6RxzXrYuN6PJJ2OhpUQ69UftPzlC3U577DfkiF7j/LA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737157327; c=relaxed/simple; bh=rStiQ/fccUcpctaXQAR/pzkKBByUunJBOB9dCsHBCK8=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=lwh/o7+JZDlpg5LaGmltac+qQMo2owPkMnzkQ2krfELRQNcI9gkNfJC2KOhfn1P5TEnvb4UQpNNqq4R/ogmkcbu+LYdH32WrWNyzdKJlAhFUfEoP/0fplz39kePIhdwSjI0v5Wafs1D5lu/iXs+p74R6ku+F+buK66OOnsaw7wc= 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=Xp4AkVxU; 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="Xp4AkVxU" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ee8ced572eso5263644a91.0 for ; Fri, 17 Jan 2025 15:42:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737157325; x=1737762125; 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=Suwwci6Z3oSWd93u/s2RL+pxTNcRUFQgijnV23Hb+68=; b=Xp4AkVxUqFo1GPOe5LOI3f13UMj2CzaNMpNZAhGrIAGWg35H6FM/MHaBZ/qdxim/iA JVgNE8GGqzhdgMtcwR2C5l91y7hzgH0Ac6P3DcgxQjaKwt/2n9Qy0ac5pMC2QCbcTjKs HBvNErvDsu+DgKfC3VQd0UkVNDsQwUUBGoj5gVMRut39AblGRewDBT7+HVs62XbfxVmV QMTPWRKKBs/RcAIOqRy0im7ioZw8HNlz8IDf1pl86w2XcONy1Mf69H/XzdlkAdVo/RAa dVQE3JpO4fZ3ZQ1XbGV8v5+Npr/Y+Mug0bFyL8mskDe55FFfGMmJ8T4/xvE2E/TfAib9 i8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737157325; x=1737762125; 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=Suwwci6Z3oSWd93u/s2RL+pxTNcRUFQgijnV23Hb+68=; b=N3JtjrIcgSx5b3pzm4NExCP8XOFIYdt4WzX91UzNynzme3dQQ3nYjBTvqM+C7qL3z8 cqrO7IQxL6f3tChH8T+X1oJni0zWM9Tz2DSTFGNOmIMXOnBMNPdM42PT52pJO79q1xq7 cGiARa234nsy+aVfftVmB7vT7AaO6sg0hyV/e3Hs7bPGNwtVa+mXivYSoPrD2fdFy+h7 824Ic9kxEpRHDDmNPKOXF7laKb8lbzqFkGAY6EML+rcS2SUrR0bi+P0eeX9gl+m47YbS hPDL060Tay+/yVNYKjQi8H+6BSrUTtRFNLbltSnf0Mjb83t6a94ftM2WScDeRZN7CXbD 5/Uw== X-Forwarded-Encrypted: i=1; AJvYcCV48IXniOue9IeMPixyGnwgB1mMc69IeR0Gl4tG5deK17mav6fDeS886PmS8PNex80GxP4il8/+OKQPTJs=@vger.kernel.org X-Gm-Message-State: AOJu0YyI5H91qNLogSapLl1wk34xgzgj4qYnrEi0r/8OSLT59Ij/DDIY +LmMARe1fQGlFc52VHBBsX5ysnAdb5E/3LzgUR9aox1YoAASE88k1gnJ+rnnk9S2sCsxwl6jh9L KJQ== X-Google-Smtp-Source: AGHT+IH3sThoJCsgXeUwF6aK+fofCIh4K84bCruncAmwnf/C3ocp5JI8pkKhKkdSYsK+4GwI9o+vHxHS3oc= X-Received: from pjwx14.prod.google.com ([2002:a17:90a:c2ce:b0:2ef:d283:5089]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4d01:b0:2ee:94d1:7a9d with SMTP id 98e67ed59e1d1-2f782d73246mr5571872a91.32.1737157325597; Fri, 17 Jan 2025 15:42:05 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 17 Jan 2025 15:41:58 -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.48.0.rc2.279.g1de40edade-goog Message-ID: <20250117234204.2600624-1-seanjc@google.com> Subject: [PATCH 0/5] KVM: selftests: Fix PMC checks in PMU counters test From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Content-Type: text/plain; charset="UTF-8" Fix a flaw in the Intel PMU counters test where it asserts that an event is counting correctly without actually knowing what the event counts given the underlying hardware. The bug manifests as failures with the Top-Down Slots architectural event when running CPUs that doesn't actually support that arch event (pre-ICX). The arch event encoding still counts _something_, just not Top-Down Slots (I haven't bothered to look up what it was counting). The passed by sheer dumb luck until an unrelated change caused the count of the unknown event to drop. All credit to Dapeng for hunting down the problem. Sean Christopherson (5): KVM: selftests: Make Intel arch events globally available in PMU counters test KVM: selftests: Only validate counts for hardware-supported arch events KVM: selftests: Remove dead code in Intel PMU counters test KVM: selftests: Drop the "feature event" param from guest test helpers KVM: selftests: Print out the actual Top-Down Slots count on failure .../selftests/kvm/x86/pmu_counters_test.c | 143 ++++++++++-------- 1 file changed, 83 insertions(+), 60 deletions(-) base-commit: eb723766b1030a23c38adf2348b7c3d1409d11f0 -- 2.48.0.rc2.279.g1de40edade-goog