From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.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 2FEF8238C0A for ; Sat, 30 May 2026 00:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780100619; cv=none; b=QPEKYQ7hneWrIKh2HeA/mASYCC+rGx8oevwFORWT5WILWrfP2CgxbZkwHp97RFh87EEi0liOQxcyNktuYvi0saf/NV/dhw3lKd8GyKJNRos9r+XQX13RtCPUKt/bt4jpb0eYsbNBMUhdIF7H/uWnGEoFq29/uAqwIwO5oZgrcwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780100619; c=relaxed/simple; bh=YHk8ukGNiO4CYahbZWbONFlefLkTB31ABcvUQFu0I2E=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=QB6zKiGltNZsDwtTVxYlyxdpcmF3WYC22ianehV5zQcfautxjsWwk7uWfMGkKUF/RGAByh2blOP6GFfP4Zi5mMlIRVLX6XZHumEmXBfEMMrrp+uMqAzDCbN+y04avj6fee+J2ir5NSu2GZ+x11Wo+TrCFZB9hB1NyI4XzcFz0GA= 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=GiFhZEUo; arc=none smtp.client-ip=209.85.214.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="GiFhZEUo" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2c0a81c1738so211955ad.2 for ; Fri, 29 May 2026 17:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780100617; x=1780705417; 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=zpKIBxF4TwirmU794bEiVHTfk4L9neuBdaiGjtHF4Ic=; b=GiFhZEUo7vw88iNCUHwR9he7YBkbXqngNtNk8vFV1jro+3qWHMxwk9lqS2ZjTYypXG 2/TW5KzT5/bgZKaNmvlw5ysltEzBFT2YsxyordWA5cWHWdH4HV4blf5Qnjr7p/EusGpo JKMP2BcqCK1ji+LjlZYvdJzKP8ar/N6nmy7fCayYbTxI7y9dCDLeNz6/UtAF6bC/Z+c3 wr6Q8jfEs551qcV+/Ui3LtNUURj7eKe3UFV8+HfkTOWTgHkAIkrAOM4WGaUowhVEV+3e rWaP3rh3NKfN3u3EhsG3++tXHoGVtrP9V6t6wQmSdUbrUnC5A3EDOKuDwPB0pDbu1p8t JWVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780100617; x=1780705417; 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=zpKIBxF4TwirmU794bEiVHTfk4L9neuBdaiGjtHF4Ic=; b=BKH5OaTxsBPIovPY+yXpRqU792SDT80viXf1JoUv4yEhDyIWF93J8MAQ0sAPi0pRRW TiWfovJ7RdUr72SV49yDBO5IVMLcFvayt+qYzhJczrNGNowcUHzifR2JHlpfxOLUrsZB ZWdMDWPFiYh4pmXlJWHeHGRzv/745IPi3aujA+KOYiSby2KaLls1JBQiyc2a2M2V1v19 DjL/kMuuVL1n62D6x0zLaWCV21gmyG3hZW0DhfZ1XuIQtims38jsGcPnEQMliroSwAL4 35JlGbto8sQk7Oegqg9BU/Xhka1DdrnjfGfO3rxO97FH+1tfybcxtoLxgGAP/iZJxMAq /2lg== X-Forwarded-Encrypted: i=1; AFNElJ9dAv4LaCUke++jqMAj8V/l1vMcqxPMniuB5OkPtjEr8xs6MP1uUjU0IaevUoSSRjoDkLJmGjdezsK5juY=@vger.kernel.org X-Gm-Message-State: AOJu0YxoO9fYBsMIgU6pYl6NCvijOW1KwuaVUVlU0Op7LopZ1yW4X850 U7vMEpDFnXzcaZyQ1JKUK5sCmr56DXw+UtoqN+frK9GrgXsXk8lqxw4I/vxFrfHTLEv2NLQszcf w9wkNPH9Z X-Received: from ploe7.prod.google.com ([2002:a17:903:2407:b0:2bf:a0d:a7e8]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:da8d:b0:2bc:ac76:c1cf with SMTP id d9443c01a7336-2bf3683bd81mr22990915ad.24.1780100617198; Fri, 29 May 2026 17:23:37 -0700 (PDT) Date: Sat, 30 May 2026 00:21:33 +0000 In-Reply-To: <20260530002134.558837-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: <20260530002134.558837-1-jrhilke@google.com> X-Mailer: git-send-email 2.54.0.929.g9b7fa37559-goog Message-ID: <20260530002134.558837-19-jrhilke@google.com> Subject: [PATCH v4 18/19] 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 0db4ea4eb1ef..967083b8e2ff 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); } @@ -187,7 +188,7 @@ int main(int argc, char **argv) struct kvm_vm *vm; cpu_set_t available_cpus; - 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; @@ -210,6 +211,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.929.g9b7fa37559-goog