From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 647FB330676 for ; Thu, 18 Jun 2026 20:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781814123; cv=none; b=nW0VEi6JPmm44K8q9NOrPdDmFLPkVC5o640WOUIIS+uQxVjunicHx0BJM6NMcAAdRVoKrohTH/OzHfngHL1foZBQnBL6WPotDk7/6YANZRUSA2paUICNF2tGKUuz6cDO2tIph+N1/tf1qP6XKcldbbAShRbEzIEgL/56wmcCs/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781814123; c=relaxed/simple; bh=oZHAxpIqUFadijIyqON+Dd9Hmvbr+/PPGnzg5RHUNoc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uURIurWH6265G9M69SNC42NwKQoc4hkNwc/BBlwkXDY61OR3e2ywBo1rnprWvooCGsBBvKiZeu5WXIwGkzIMqMcd6ZpWa66JLcOCpoxZfGXQRYflmp6K6z7/lyCyfLp6+IoFXIvtt9IU0+hgtBiXrnxzN/tSwRW7RvZOC066tts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ujUaSZ9C; arc=none smtp.client-ip=209.85.210.179 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=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ujUaSZ9C" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-84226d0f1d2so1001796b3a.1 for ; Thu, 18 Jun 2026 13:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781814122; x=1782418922; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=R8xCK89QfRMaVvrkpnB5YO+Fnx8pGynYV6YoyF7gSgA=; b=ujUaSZ9CRapWP6uS6U4fa+dmeKf9GDu+09hObA58BmiAQr0YR716EzqrDpXj2W9+Zt q5vzucTO5ydIeP2X/E0Fr+dqS4S+f5eb1PB/VOz57hGwOKm7KSn9feqmPjHjo/4WZBD3 tgCr5rDSmkaAivOFdPtLBonEkzK3tNv5dyQDkL5uhFWEU5IO0Fonw4fNe6VngzPKC2CY RfzAu73uleo+sXiTdXPFNbrUauYAgVJeCrkYTj02jDq5y2E4pVI1V0WMDGc/tkegkWoo 9UvxmbPBHLC2l8tYtPWnmguNI7q87bOZ5upWDU6XHyKqht+AKA878uEovRoTdjvJMbMS 4APw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781814122; x=1782418922; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R8xCK89QfRMaVvrkpnB5YO+Fnx8pGynYV6YoyF7gSgA=; b=Xalj/e3l1rX+oyDhqsOqTshmLTnfQw3guL+zb9zu9LBtUcrc8CNWKnyoPfAL+U579O LYG+y7CV7sjl4wW+eBjHPNb7SnaEyceWQvY/98O+rTzPID2YCz2RA/4fszeHM9dtT+8H txsFFYmSnfCSjFk9eejVcoYh6dfINPShvkOGuv687Cs6CZfhCK0K5xfaHZQu+7ri5gwV 0MrqCnRoeD3VT+jLYWmTOl8cFXF8vA+FEJoo5XEd2CZ/dODUKK+4MzKN2sLXEZJBMssX QMsPIhFfG3ZogrUY3duYTzaiSwfbdqH06jpeiWWH+/GVx+PUrnUwEyijLAeeZVM0gd7B RgxA== X-Forwarded-Encrypted: i=1; AFNElJ8Zgfh7hSvwKuZ0ycqGVEqu7JgEptgGVYpGnrWx4pUxnVpyVINov1MiFCDWs7tjVoNS6YOOxO62V+iIwoc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1x0L1u3+GeAjCW3vATaRCqfC+4lMeU79ZzYJQB1a/3cyPz6Gf 5ndd7Qf1MC03RaXwOpMY7PkuickopgB7sTFsdQxA4pY5JOBvqb6+rZDZoXpvdH+C7w== X-Gm-Gg: AfdE7cn0a4wRdGbQzXIKY4o4dIVxxRyF9L41FU2sAxutcwB0kb7rjZCMbzbD6sKakah 5EcKsjVq1wz4RDvZo4mli5S2/C3kylcVUXuFnk9+X2A87svrGz77I7nLUBPQbhty2YE+n0SrFsj Tq43Fmvt86EWU3+UrQ3hZUnXNpBHnXwYeMvvnYeh+5HdTnDPL02ZKLap12OgSn2OrNCj4zfcow2 9L3ktlSxCun/yonfgMMDJsgnmgijcWjU9Xz+jm9ZDjEj1POt1CiQTUj8TjugJV8jjNY5tcMcvgP Yfy2da4ceuedlh2o0hnoT2JsGZEbEm6ruePkmefjUUcOCvcBxQf82vmP8ZB8yaiBBVpIEEzcjWR bZGOslmtooNKN7gd/00enQ1vWmEdc/nFgCSFOmS5ruFy63zUd6k4Tfjs+abx2kAs2rorlWqQDZi K+8XWWtV89HsDWD9+Bc7f8cbYExwpYzZzSz5qPAaXhA1RA9GfNiuc= X-Received: by 2002:a05:6a00:4fd1:b0:845:17a6:5741 with SMTP id d2e1a72fcca58-8455079c80amr485384b3a.1.1781814121017; Thu, 18 Jun 2026 13:22:01 -0700 (PDT) Received: from google.com (56.149.168.34.bc.googleusercontent.com. [34.168.149.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8453a8c9770sm3735614b3a.40.2026.06.18.13.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 13:22:00 -0700 (PDT) Date: Thu, 18 Jun 2026 20:21:56 +0000 From: David Matlack To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Josh Hilke Subject: Re: [PATCH v7 09/20] KVM: selftests: Add VFIO device support to eventfd IRQ test Message-ID: References: <20260613002031.745413-1-seanjc@google.com> <20260613002031.745413-10-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260613002031.745413-10-seanjc@google.com> On 2026-06-12 05:20 PM, Sean Christopherson wrote: > From: David Matlack > > Extend the eventfd IRQ test with a '-d' argument that takes a BDF (in the > format segment:bus:device.function) of an interrupt-capable PCI(e) device > bound to VFIO, and use said device to trigger interrupts instead of always > synthesizing interrupts via direct writes to the eventfd. > > Using a VFIO device to trigger interrupts validates the end-to-end delivery > of IRQs for "real" devices, and when supported by hardware (and KVM), also > validates interrupt delivery via IRQ bypass, i.e. via device posted IRQs. > > Now that IOMMUFD is a thing, auto-probe IOMMUFD vs. "legacy" VFIO by > temporarily opening /dev/iommufd, and skip the test if neither IOMMUFD nor > legacy VFIO is available. Add a '-t' option to the user override the probe > logic, e.g. in case IOMMUFD is available but the system is configured for > legacy usage. > > Note, the device must have a VFIO selftest driver in order to work with > the test. A helper script to list supported devices will hopefully be > available in the near future at > tools/testing/selftests/vfio/scripts/list_supported_devices.sh[1]. > +static int vfio_setup_msi(struct vfio_pci_device *device) > +{ > + const int flags = MAP_SHARED | MAP_ANONYMOUS; > + const int prot = PROT_READ | PROT_WRITE; > + struct dma_region *region; > + > + /* A driver is required to generate an MSI. */ > + TEST_REQUIRE(device->driver.ops); This series is probably going to race with merging another VFIO selftests patch to make send_msi() optional [1]. Can you add a check for that here? TEST_REQUIRE(device->driver.ops); TEST_REQUIRE(device->driver.ops->send_msi); [1] https://lore.kernel.org/kvm/20260609232855.3808971-4-rubind@nvidia.com/