From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.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 880843806CE for ; Thu, 4 Jun 2026 19:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780601125; cv=none; b=dVKFbFbDpvsJWu793Sb+BdxYk0I439VBFv785AHSISC1VnQLLaMO0mGAv6A8FojsXvCad5gbKSghOQblwqe3ZugoQVZctjQO/yshaH9oogSx6zXSLoocbDBXKuYGJYgUrfqgQH+t/QpaEbGaEn9ZBjUl5utLHVQpD+Avp4CmRCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780601125; c=relaxed/simple; bh=L/qPSoCGOV61t2VOU6VVNzyHj3wvzTgu4C4avnokKvY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=SVsibCaQVYBMQYej2yaaBzDY9uJG4d9xR7Jfcpb3skib4lDwAxP+faZcREcuhV6COur1WoV0/MK9gT6wKIWdc6Rt/R3JkyJyA94Bz1dUs8ZEenR9RHgeU5sqTPrNU3LJtNK3/0fpTkw0dpcQ6+Egr/o2PY7n8uYjZW7gVwUOjo4= 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=gyidbGqP; arc=none smtp.client-ip=209.85.215.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--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="gyidbGqP" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c8584e3fc96so629657a12.1 for ; Thu, 04 Jun 2026 12:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780601124; x=1781205924; 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=ynr9RIwBP5Pl/8p+4aWx2v/BAwSvZs2jJzCTuS4p7H0=; b=gyidbGqPRThYjcarB/tfGlHv2LASXCw21orrkBN70JOrU5lba+6smLTogFX2rWD7IX RsANM1aL5E4fBBh/OI31CJOTXgCUbO4z3HGeW7BoFOPatTCUvB3cgNrKx6vysQHKFDGi VrYsnuVDTKw5Nr0MQoUplkkZ72+WheR1E5Zn2p/D7sUKdr38xjoV03YN3MuWh+eO5Ew9 fVZgZzA/aVR/tFeO2jqEO0adGWioN3UcCRpFM6MBqFQgPOLtHASXII0pVlZO03EjfdqU bONm4FtUvXzRWcqXYyzrE2e8iZSjFWbsrOFaQsROdOT+iLvaKeixGhfd8X2JeqBkTMTF eQug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780601124; x=1781205924; 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=ynr9RIwBP5Pl/8p+4aWx2v/BAwSvZs2jJzCTuS4p7H0=; b=UKEkhZS8Y/9FpUHTMuT8F1bD4rqYWYxv0abM0TgvyOo6HVyAWq3Zg17KA/kcqZMD2c riv22iPSgDuzF+ucO5jcleA1zNMG+xayU3V66DljvPMEeG5kmG8RmFgHpskST6Hs0X8S rLo4d55MKYTpdPX+Uei9mPH+PmBpe9EBq/3FvCmutj4j6/5/uniddrL7qqN9nbZrVo4i 1srqWFPM6Zjba9M+grLwSh/cAmvXQFoEuVp+nTmkDm/1qFJEEa6Spk0J8b4L6uVm45xG 5M7EoqsQkxwFuMKezt3iLxIYKp7Xk7e+tw8CKqBDW6s+uU5h3BQDyUUkma0xGU3scFBc PbMA== X-Forwarded-Encrypted: i=1; AFNElJ/FhAliwvMW2r6Mcf9qb00hKWt/BqtGUubLaSxB7IXfXYHTxP3c5/WreidY/Lf/YT/+QBx5bhVZiOGXGNA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy93xezeOq4WuU2xWZ+wwYx9MgtTGTHMzmjdaBLb01bWnafkdBT OJjtjbGxHmGbmYJAhhz7hefpufLLsPBnRqmTCrc4NKtbRjsk9sfk5jjZAzD5dna5QVani/V8gc7 i0MhpFQ== X-Received: from pgnp18.prod.google.com ([2002:a63:7f52:0:b0:c85:1159:ffb2]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:a394:b0:3b4:87b3:913c with SMTP id adf61e73a8af0-3b4ccd782b0mr491614637.14.1780601123586; Thu, 04 Jun 2026 12:25:23 -0700 (PDT) Date: Thu, 4 Jun 2026 12:25:22 -0700 In-Reply-To: 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" On Thu, Jun 04, 2026, Sean Christopherson wrote: > 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); *sigh* This is beyond frustating. I have A PERFECTLY FUNCTIONAL KERNEL, but this test VERY SUBTLY "defaults" to IOMMUFD. ARGH!!!!! And to make matters worse, if I enable CONFIG_IOMMUFD, but don't enable CONFIG_VFIO_DEVICE_CDEV, then AFAICT, I can't do a damn thing with VFIO. I dunno, I can't get IOMMUFD to work even with that. Worst of all, the changelog SAYS BLOODY NOTHING ABOUT THIS. Please, for the love of all that is holy, when sending stuff upstream, think about how your code will impact people and environments outside the world of Google. And more importantly, *test* your code beyond Google's highly curated environment.