From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 0C3402F746D for ; Thu, 4 Jun 2026 02:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780538571; cv=none; b=CT65+vkvVhRgIbU8hPaX6puWQfFjJn1Ntrk5XJCV9a32xDmbZOJmlRXSNKU6CbEIAtrKmZIRPey6uFlLVrqVm/V3x2NaQIS98Myj51+wM6FJc0iPvv0i2wbyR5xn4yBiQVjNDJxYo9ezEeePknQ2KqYiMi+28+2cvNrci8VwjD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780538571; c=relaxed/simple; bh=crMle9j802BTtYp3MWSaBHqe2spiu/UwBKtPWyz8ZEk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hz1eFOYzJJeiimp+97Vm04QMfserYUw88qL6PhFnFPWnd5l1b9Gpal7VCNAGTMYDcMKuaZlM0Vf+Oei5xWyB2yv/LghWwqVE3HhqHNlo8OHHMvGElxbYEsbClL6WxKH3ZCtxgqqMox/lIq9Qa+0v4BvZDXrahSB21tbjlWTT8d4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jrhilke.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YaXO5t3h; arc=none smtp.client-ip=209.85.214.202 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--jrhilke.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YaXO5t3h" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2bf004bf8beso2234375ad.3 for ; Wed, 03 Jun 2026 19:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780538568; x=1781143368; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=G3j+8dIDJLDE9oCfttORZmcxZeBh/jFN2elFlpkhO2M=; b=YaXO5t3h8GCszjESfB1NapCEZzHOd9Xb07O3FWb5nQp5g9l8IWdm06MaEnHYWyEKgM TGCk0e+hTf7v1cVdisHHTSt7i8jQr44kkExpat20xr0DwBho1EZuz6cGPxSLMKqFvZc/ 1V+1GBhoAp1ZPFQWa1CqFHDiPk7WBIg+uREpS4+sy6mFTgMUycjxUfe2xVOYb4m16knu wuaw7Dv7bDE7uX4ChlnLLw+UX5E7TYtg+ApLaaE2DOfDF/36mHsNG5Hekp3U/tLqZGxG 7JlDJpClsJMO9OWhy/GBLIL1gKisZ6S19ci7T5GCFvCnEs8AatM+jrwWLn0pZSevuvFe Sgzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780538568; x=1781143368; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G3j+8dIDJLDE9oCfttORZmcxZeBh/jFN2elFlpkhO2M=; b=sdl2BEti8eNzrTLoXeHmKHtR4HnnFMvoGl/pkVFcF+PcEQBsW+2spHmys+PWJDtXxv JFJu7SWshfdVY9s8JRLQ5VEgC0fOXlKxzjKmOYDQy3cjb2DpSsBWakm4M442VDf5P+FM Mtx13HQ4wv6E3eXlw03/Ni4rF9/f6exquKPNnlARc8+mN/Okwcqa8MeMM6R5WGEVG3Fd VIMPtAIwhA0PGBVIVexUrTVlf3CXIzQrH4iJ/1muy2ptXnLaIZ24lgsjXvXFfAQ0zM1X eBLg91MXdxNNQT7UrwyBK3L6w/LATW3uIkkdkc0Now4HdO/AwMXhgGzw+aFd4t37MJ8x Vy/w== X-Forwarded-Encrypted: i=1; AFNElJ/BJ0hEIZ3NJQtK+wFllxeH4wtDNYSjP7cEB3gyMvJPudfL/2EdURy1Sm9CZEJZY1TaPs9FhZESag1WSN0=@vger.kernel.org X-Gm-Message-State: AOJu0YxFLHlYAeWKnfn2mK54GPG/4GZhj3aP5KNXtCpqHF0gzpbm0DYN UhmP8NLcHGpDRdVDX8mZXOKnAlZoqplp7OEjToRIWoDi/XprYDE4WRKUfBZ6t/0c3WRpn+/wW6J GFGEIo6Tk X-Received: from plbx13.prod.google.com ([2002:a17:902:ea8d:b0:2ba:3bc2:e980]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ce87:b0:2c1:11b8:3c80 with SMTP id d9443c01a7336-2c1644add47mr59129495ad.30.1780538568115; Wed, 03 Jun 2026 19:02:48 -0700 (PDT) Date: Thu, 4 Jun 2026 02:01:42 +0000 In-Reply-To: <20260604020143.748245-1-jrhilke@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260604020143.748245-1-jrhilke@google.com> X-Mailer: git-send-email 2.54.0.1032.g2f8565e1d1-goog Message-ID: <20260604020143.748245-21-jrhilke@google.com> Subject: [PATCH v5 20/21] KVM: selftests: Make number of vCPUs configurable in IRQ test From: Josh Hilke To: Paolo Bonzini , Sean Christopherson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Alex Williamson , Josh Hilke Content-Type: text/plain; charset="UTF-8" From: David Matlack Add a '-v' flag to tools/testing/selftests/kvm/irq_test.c to allow users to configure the number of vCPUs to run in the test. Co-developed-by: Josh Hilke Signed-off-by: Josh Hilke Signed-off-by: David Matlack --- tools/testing/selftests/kvm/irq_test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/irq_test.c b/tools/testing/selftests/kvm/irq_test.c index 1d66293b6d0b..41c50caa928e 100644 --- a/tools/testing/selftests/kvm/irq_test.c +++ b/tools/testing/selftests/kvm/irq_test.c @@ -144,7 +144,7 @@ static void kvm_clear_gsi_routes(struct kvm_vm *vm) static void help(const char *name) { - printf("Usage: %s [-a] [-b] [-c] [-d ] [-h] [-i nr_irqs] [-m] [-n]\n", name); + printf("Usage: %s [-a] [-b] [-c] [-d ] [-h] [-i nr_irqs] [-m] [-n] [-v nr_vcpus]\n", name); printf("\n"); printf("Tests KVM IRQ injection via irqfd using an emulated eventfd.\n"); printf("-a Randomly affinitize the device's host IRQ to different physical CPUs throughout the test\n"); @@ -154,6 +154,7 @@ static void help(const char *name) printf("-i The number of IRQs to generate during the test\n"); printf("-m Pin vCPU threads to random physical CPUs throughout the test\n"); printf("-n Deliver 50 percent of IRQs as non-maskable interrupts\n"); + printf("-v Number of vCPUS to run\n"); printf("\n"); exit(KSFT_FAIL); } @@ -190,7 +191,7 @@ int main(int argc, char **argv) unsigned int irq; int irq_cpu; - while ((c = getopt(argc, argv, "abcd:hi:mn")) != -1) { + while ((c = getopt(argc, argv, "abcd:hi:mnv:")) != -1) { switch (c) { case 'a': irq_affinity = true; @@ -213,6 +214,9 @@ int main(int argc, char **argv) case 'n': use_nmi = true; break; + case 'v': + nr_vcpus = atoi_positive("Number of vCPUS", optarg); + break; case 'h': default: help(argv[0]); -- 2.54.0.1032.g2f8565e1d1-goog