From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.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 5640F4CA28F for ; Thu, 4 Jun 2026 17:56:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780595783; cv=none; b=HYatq+dHUogzHeHIO5ii69T30enHS22644y0WhY3BBr1EfAxMoLJKj2QvqKAVsPuVtHdAIJz6+e0Y1W44AnYsQUh6AMVKOkviot1UijAvNqyeGOP2jD7hCu0PfCuMq/S0rm2rPlFEdJLVeihbxxG4GjAkfWV3SRVBYNKFXMKkVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780595783; c=relaxed/simple; bh=BJKSJ0f1ghLKefz3RvJxRJoHhEprzQsxYPHdnQCwk0o=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kjPAgHr6p+WmhMzjvCcLDLwmALV2VFjstFGGL31XRjaLKHxhuhiP5z/hJv5VxTmTkLcdd4UO7xsgZ5AxvMvXyHtFkbaWeNWss+Du4qjeefTvccMIE4zxkzJXf6Fy1r86giOAbvuBLEQftjoxQJZD67+nvxEDQfYuGcDwzpHUUnI= 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=OREm1alv; arc=none smtp.client-ip=209.85.210.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--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="OREm1alv" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-8424aac207eso877362b3a.0 for ; Thu, 04 Jun 2026 10:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780595780; x=1781200580; 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=gT0auPM73vpy21EPQcsi9jdaJb4vCSUAPDWuR3ICNLE=; b=OREm1alvflHAvccs15J9+KSUt9Kd2n87lT9D8LydQlI1E5exB1+yCGUckcaTQCe1uM QCFnmZXZRTzcjlDK+omGCddSZi41zmCfCGNLGOp3zuMzAWHxDU0YzZjHzBp1eYKE1xj4 nYrmRDVnSB57n12CLoEw3Mg9FzMZmrEeo8pGwIdY/BWszbLoZxjsyVBXvZS3mZAjfZiz jjxNy9Rr6KqIOscK+NAj1tEXg9KeOUXIf7P2eIU4P8rtbNw6H28KrAOfTfudPkgOaW4q MwbLGQ227FxdvbxkenswA9dHgfumz7eI8joBwFrH4AZeJNVOySkJ9nsEe6sM05a28HSm KnqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780595780; x=1781200580; 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=gT0auPM73vpy21EPQcsi9jdaJb4vCSUAPDWuR3ICNLE=; b=KO4tn67LTArswIkpqHJ8CYIa0vsvhANyOSxAM4fZnP/Lge+a7yVM8lWrpE8/hOMNT6 FoSvzjGLwb1347mENTfMbiyWByntdeOguv6sz5dlqYDuEbvwPVEucumekUPP3zfI7H8G 4cd0Ivx/Du5k78cOIbXPGrEt5kr+c/0WvGn8+XGCqpr40W0k2pZWfl6fREAqLcLhxz7E 2WXHj3F0NDqLjYktRqkE3V7HKyYxjnuBCGyjyfXdF/2/RJK01ac1bN+8qaORUcLIW3Au K22BACVRFOCf9J4SdJCG/m5k1HHVp4TihGKFUQEpXAOGnKITxT3QseQ/HAqKOhEMIB+z f87A== X-Forwarded-Encrypted: i=1; AFNElJ8iZRFfmWnQo37Eq8llgOv+OKCQXChtfIQ97qo5oP/NWppNpjPZND3JVZ5AyIxCso7ErZDUCSF5y/69gmY=@vger.kernel.org X-Gm-Message-State: AOJu0YxQDsSamp/O4HE6uugKXqs35lQ6HxGHqUBxcgFFW77kYsdTj9yZ 7Kj7UpWk5xA9cYSTRFCAHAqCvad5dJ3SrQ9WMQm6dcF9qjNZ241kTkVts8ammw+CSYSQUlBm30c 0sr/QYQ== X-Received: from pfbcz12.prod.google.com ([2002:aa7:930c:0:b0:83e:c835:edc]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:2d20:b0:842:21f0:5113 with SMTP id d2e1a72fcca58-84284f790c2mr8883901b3a.24.1780595780380; Thu, 04 Jun 2026 10:56:20 -0700 (PDT) Date: Thu, 4 Jun 2026 10:56:19 -0700 In-Reply-To: <20260604020143.748245-8-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> <20260604020143.748245-8-jrhilke@google.com> Message-ID: Subject: Re: [PATCH v5 07/21] KVM: selftests: Verify IRQ bypass works in IRQ test From: Sean Christopherson To: Josh Hilke Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Alex Williamson Content-Type: text/plain; charset="us-ascii" The shortlog is at best misleading. There are zero guarantees that IRQ bypass is supported and enabled. On Thu, Jun 04, 2026, Josh Hilke wrote: > From: David Matlack > > Trigger interrupts from a VFIO device instead of emulating interrupts It's not emulating, it's synthesizing. Emulating implies there's a device of some kind that the test is mimicking. > using KVM eventfds. This verifies that guests receive interrupts via IRQ > bypass. No, it verifies that delivery of a VFIO MSI-X through VFIO=>KVM works, and *may* verify IRQ bypass. And all of that very much relies on the eventfds to be in place. > @@ -119,7 +160,17 @@ int main(int argc, char **argv) > vm = vm_create_with_vcpus(nr_vcpus, guest_code, vcpus); > vm_install_exception_handler(vm, vector, guest_irq_handler); > > - eventfd = kvm_new_eventfd(); > + if (device_bdf) { > + iommu = iommu_init(default_iommu_mode); This needs: diff --git tools/testing/selftests/kvm/irq_test.c tools/testing/selftests/kvm/irq_test.c index cf4568718cee..2e7e100d4815 100644 --- tools/testing/selftests/kvm/irq_test.c +++ tools/testing/selftests/kvm/irq_test.c @@ -235,6 +235,8 @@ int main(int argc, char **argv) } if (device_bdf) { + __open_path_or_exit("/dev/iommu", O_RDONLY, "Is IOMMUFD available?"); + iommu = iommu_init(default_iommu_mode); device = vfio_pci_device_init(device_bdf, iommu); msix = vfio_setup_msi(device); So that the test skips instead of failing, and to provide a helpful message: 1..0 # SKIP - Cannot open '/dev/iommu': No such file or directory. Is IOMMUFD available? Because bluntly, the assert from the VFIO infrastructure is awful: tools/testing/selftests/vfio/lib/iommu.c:448: Assertion Failure Expression: iommu->iommufd > 0 Observed: 0xffffffffffffffff > 0 [errno: 2 - No such file or directory]