From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (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 79596408600 for ; Tue, 4 Aug 2026 21:00:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785877250; cv=none; b=HnuU4Ux+ar+ibVcpD8LvsdWwfCYcpN0cAq6G+Li46cFXBleG6xB6By47kIyFrAnZQcs64tES1ED+/He/qeflW3YIPzWte1SnaYTvG4XFmCAZleIzrmBvXGXh4GVeYrY7PdFULgP2x+Jz67TC7vIbCrM0xCXyLVQ0sI7EMut/3wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785877250; c=relaxed/simple; bh=OjMPFaCqIgrWzTBXeilssj79ZP8+mzPKddW3RhC43O4=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=uk4D9vcKo+4w7iImvwxEcWsFfz19+20uFvPoMhzxlMj3JOp00n4HGN7oXO2LQ0ptbdeP+erqBRea0AR6/vlRceHZ94JSpiGO4XOPih96WvYfntLP3EfWpNVYHWGkpty3q+DdNOCfqjRi/azNqpElIiji38T5ePwPmHM3onBf35I= 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=APzQibDE; arc=none smtp.client-ip=209.85.210.198 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="APzQibDE" Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-84859a64079so387111b3a.3 for ; Tue, 04 Aug 2026 14:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785877249; x=1786482049; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date :reply-to:from:to:cc:subject:date:message-id:reply-to:content-type; bh=3i3TcWKLRQF+gyvl9R4u/4p1LucwwR0F1GEdHIhJ5Fk=; b=APzQibDEFFp6JtgAVsslj7QPTLhavmmx1tP0NCvj31A8kLzyiJlUybj5a4khspB1BW 8nCI26Xgka2MDiFIvx6ZokK4HPeWVEmd2LwuUvVdjIeTFRJn4EtsXsTS6afwDYRstPxG XhpqAC7I2H5QN3veQS/wVUkKnoQsQsLoEMc9LmdiSH1O/D4Fog+t0LrqQCAhzYksUIKE eKi6IALlgGCIBhXlQSMbetNICE1LiITgXoHfBEnKCTaQssHMyWyQ0o5Dv2mC3KbWb4Ct LgRDffdx7K22jH1LG/IuC/v0mMUkUtX+3/Ab1xoClo0ktXRbqUMUEn6b+r+6A7ipiSOc dmAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785877249; x=1786482049; h=content-type:cc:to:from:subject:message-id:mime-version:date :reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=3i3TcWKLRQF+gyvl9R4u/4p1LucwwR0F1GEdHIhJ5Fk=; b=ADTDUlRieiBcAKRcMdvNrjip2vJxBNUi6dXVyhw4a2aDCoHCQXAtNRWhT9pCyjS7KE N2GeadG2r5WQ4M7ilkHsyQyVtvhZCX9JBF0GiffgBhNX9u5PddezRtdpPRpm+LZa7VdB Npawf+4Q5sDlbuhuoQFmUkkvhC09QTRPh2pu49YnK61t//sN4ddRUORsEi/hH1OYNrhf 16X4qhFG4bWlRsx4sHIfxm/aDAYu4XzdSCyx9AoWWvXf8XAA/UnzCFH3zzM/OfZnbjAb 1YUoFDztt+h76Dl4bQgRlpS3CqFmoDWFY74oGcYM/D7CwLKPw1GjL0G41vDkqAiCvL0A RG6A== X-Forwarded-Encrypted: i=1; AHgh+RrHwR/v0RQAfns5Eaku8p9NaAnhwkHZJLZKzBAzSRyAdmxd9Lo/OdkTBV9VekIwBj7KqDdjfyMk78YEuFM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7e9L0IQEn9ZnitbeDIvmqKsag/Pq6ynMHKe0NcUzO93R7WiOx CI0FEqsoLDU0APTsetDVyvNqevov7AR+bfLUX4bGX+VpcyMmxNuXlu2lgBL4jtKsav7fEmAdj4M pin7oNA== X-Received: from pfbgo18.prod.google.com ([2002:a05:6a00:3b12:b0:848:48a0:41e6]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3cd6:b0:848:4754:28e4 with SMTP id d2e1a72fcca58-84f2dff6972mr1505038b3a.15.1785877248575; Tue, 04 Aug 2026 14:00:48 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 4 Aug 2026 14:00:44 -0700 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.55.0.571.g244d577d93-goog Message-ID: <20260804210046.3413149-1-seanjc@google.com> Subject: [PATCH v3 0/2] KVM: selftests: Reduce PMC test runtime by ~17x From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Reduce the runtime of the PMU counters test on an Emerald Rapids system from ~85 seconds to ~5 seconds by (a) testing one random GP counter in the arch events test instead of every GP counter and (b) creating one large VM per "major" test and then running each subtest with a different vCPUs, versus creating a new single-vCPU VM for every subtest. AFAICT, there aren't any bugs anywhere in the VM creation flow, there's just a lot of work to be done. And VM creation isn't even that slow, but creating something like 1000+ VMs for the test adds up. v3: - Allocate an array of vCPU pointers, not an array of vCPUs. [Sashiko] - Fix a copy+paste goof that caused the GP counters test to always run with the maximum number of GP counters. [Sashiko] - Fix a (benign) off-by-one error in the arch events tests. [Sashiko] v2: - Fail hard. Pretend this version doesn't exist. - https://lore.kernel.org/all/20260804204048.3401810-1-seanjc@google.com v1: https://lore.kernel.org/all/20260804173437.3339269-1-seanjc@google.com Sean Christopherson (2): KVM: selftests: Test one random GP counter in PMU arch events testcase KVM: selftests: Create one VM with many vCPUs for each major PMU counters test .../testing/selftests/kvm/include/test_util.h | 4 +- tools/testing/selftests/kvm/lib/test_util.c | 22 +- .../selftests/kvm/x86/pmu_counters_test.c | 229 ++++++++++-------- 3 files changed, 149 insertions(+), 106 deletions(-) base-commit: 2dfab80a305700a45bd947350dae253ba4e30c41 -- 2.55.0.571.g244d577d93-goog