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 D86A2315793 for ; Thu, 4 Jun 2026 02:02:42 +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=1780538564; cv=none; b=ea8XVs44me2a4HO40dzCTDER/ZXgE+2fwMdcnuDHn7BR2nXAkUf8iiTsdhRMMjukJ/lONhn//sF6rMVtqOr1njfWYz2d0+H8vf8B+h1qHFJGAYptL6kHKnggCmnPsbF9Uh6c5Yn+fCEghzO5JMcFZP/VPB2XvsWW/tBKys6jE9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780538564; c=relaxed/simple; bh=dafLdLWgdXnx6V1IXIlCD6pLVM3B3uy7mgOFoWSI8Q0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=HXlIn2u3BDaK/7TeHUn7CKcrN1zvVXVhXncBqzPShifrnepFDqJdmpNRoZ7eZKQem0iAuVmIR9Nvbp3D1t/8lO8MRftGV/DF+OvOdNozjKaXYq4+qYMUIRLYqM3tAcxsF0ZQKviiO1ZVa6UNt0KB565YZ4Jlwug2M3kRDTjghek= 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=vm6oCVBm; 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--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="vm6oCVBm" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c8592a62f32so98523a12.0 for ; Wed, 03 Jun 2026 19:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780538562; x=1781143362; 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=nxNows63/pttd4Lw3zcWQn2ehHsMc8vxDlx8tQK6YAk=; b=vm6oCVBm0GQhlv8TrWXcG/OJUZQ6AYLIt+341topHvO3bLqK5zXpvbn5Cm9blVYL3w iC1qzWSH00kkgY1TOdeD7JvKiLefqBS9hDR7oJErDGmS7yIXhifkVRt3MbTbd6BqNkTH 1UGyISZiRQJRB2t91zH0W1GGESiBVkb9SLYtr+q3Qao2oT1s7DyKKT+JSUlaP0my/TYg Tbd/z+EEWRuQGpdhgFvB8XS5FC005h/PMwQc7HQB/jKbhEeavWnAsK8UBxLiPWA83Twd iQ+UzvzqegqfCGwhPPJ21+zS4Bp42cKydQkPUw4dCY29/9IKjEHxXJVuu35Bt+2Za5hC kGEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780538562; x=1781143362; 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=nxNows63/pttd4Lw3zcWQn2ehHsMc8vxDlx8tQK6YAk=; b=adEftmD9Xy+wnlabcG2n6H6UNbFZFGVfsGBVFk5x2cFXObWK9P4ODp8NzK8/by4jZs GdgrIgfBHXq0pYHpTrzR5B4g/qlhn8KSonS8yB0uvQBewpGCdXNRReGmVIJlWNTm2pK6 W81atp00fBcYEmxJOi14hRVbiGiWwI9m3bMkapb1qDDDeUpCV8goxLDZ5VEDZCBG/sUC Jdr+GlsBaZX7SFZq90f9hqq0+yegs6X32azQwUkiJqQ+x5DMP85nDXgjwieMK2zCFSoO 96mCu8pkXaIpgwzEEQaYxH/pKyQ8De9JEyFf5obyt+BCyEWfIWzqTP579sOqvD2sQWoK KtUA== X-Forwarded-Encrypted: i=1; AFNElJ8YGG4Cwig8AKP/emGBeuInfF9wmCT20vAnatfXveVsQ15sRNa1O+dz48tqs2lWpaM9KFyktNXkBiCt8X8=@vger.kernel.org X-Gm-Message-State: AOJu0YxMNEUewB2k8GYAALZy37sbOKhxiL8ZMDEveMqwTkNm/09zAgbS BszUVq1m1obGb1PgGtqz4rDcY5IpqceCvQHgbmaUVpYCwdSFSh2Rig2kbiVGht/NirUmYT+EZnz yQMC4UBG7 X-Received: from plbjy14.prod.google.com ([2002:a17:903:42ce:b0:2bf:3684:64d2]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3888:b0:2c0:ab82:6b9d with SMTP id d9443c01a7336-2c163fb26ebmr66553025ad.29.1780538562124; Wed, 03 Jun 2026 19:02:42 -0700 (PDT) Date: Thu, 4 Jun 2026 02:01:35 +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-14-jrhilke@google.com> Subject: [PATCH v5 13/21] KVM: selftests: Make number of IRQs 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 '-i' flag to tools/testing/selftests/kvm/irq_test.c to allow users to specify the number of IRQs generated during a test run. 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 b0c4547a7f14..de8c29baa2b0 100644 --- a/tools/testing/selftests/kvm/irq_test.c +++ b/tools/testing/selftests/kvm/irq_test.c @@ -123,13 +123,14 @@ static void kvm_clear_gsi_routes(struct kvm_vm *vm) static void help(const char *name) { - printf("Usage: %s [-a] [-b] [-c] [-d ] [-h]\n", name); + printf("Usage: %s [-a] [-b] [-c] [-d ] [-h] [-i nr_irqs]\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"); printf("-b Block vCPUs (e.g. HLT) instead of spinning in guest-mode\n"); printf("-c Destroy and recreate KVM's GSI routing table in between some interrupts\n"); printf("-d Use a VFIO device to send MSI-X interrupts instead of using an emulated eventfd\n"); + printf("-i The number of IRQs to generate during the test\n"); printf("\n"); exit(KSFT_FAIL); } @@ -164,7 +165,7 @@ int main(int argc, char **argv) unsigned int irq; int irq_cpu; - while ((c = getopt(argc, argv, "abcd:h")) != -1) { + while ((c = getopt(argc, argv, "abcd:hi:")) != -1) { switch (c) { case 'a': irq_affinity = true; @@ -178,6 +179,9 @@ int main(int argc, char **argv) case 'c': clear_routes = true; break; + case 'i': + nr_irqs = atoi_positive("Number of IRQs", optarg); + break; case 'h': default: help(argv[0]); -- 2.54.0.1032.g2f8565e1d1-goog