From nobody Tue Mar 24 01:12:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1773938485; cv=none; d=zohomail.com; s=zohoarc; b=H7APGiWd/Au//1IKPzafE7qzU84c+/gkLUeYj3JBV6gZVd77C7sLMEhrikb2D6XJRkJ09waHjaEoJJcH+KUPz0e3GNXoAC7KqLyr3sRWGzMsHvjCdh97dnBBpr19k/RcFRmdsrRUvkmnRqLz/xXQ/zCskOwNiR8bfolzEuMwsuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773938485; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=bYVm5TWksyx6O4UHIxvsAonDsvnAd4wn8m0FmxRFGrE=; b=AUi/PVsLlw+dMBiJGvjLyNq+4oZOu7mx5d7cAGYKvCajMEnj4Byf6CRejyM/+zwpZPIhl6mO9skaEZhwVel3KJ1IV0HRk9GGK+oHDqt9nvmxCwsVr6mAZt66iL+8nGaKERQdULBXbsiQ3F6ZCdJeFuQ1+449cW+YdY9m5faGdV4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1773938485600740.6883806554395; Thu, 19 Mar 2026 09:41:25 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2840A41B5C; Thu, 19 Mar 2026 12:41:25 -0400 (EDT) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2CF6841C0A; Thu, 19 Mar 2026 12:38:00 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 1C6524192E; Thu, 19 Mar 2026 12:37:56 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 59E8A419E5 for ; Thu, 19 Mar 2026 12:37:06 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-jVRkQXmENYmuaJeQNQFPNw-1; Thu, 19 Mar 2026 12:37:04 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B6F43195606F for ; Thu, 19 Mar 2026 16:37:03 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.44.33.53]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0EA9A30002DF for ; Thu, 19 Mar 2026 16:37:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773938226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bYVm5TWksyx6O4UHIxvsAonDsvnAd4wn8m0FmxRFGrE=; b=TtJC+n9GGGX5A0gA0doIZUXQ55CKHsa4nRtGgfRwlX5YEVhVj9LDgP+l30G92QvADpoZBG m6tth4xX3dQMyAbb2+6F3yjfQoR84oq6hzqmshXPu8MoAkXf/o3yUYcjwy2CyIl52n7Bo4 O3Fd2lf0fY/9BNM28AhFqeMasC/Uywc= X-MC-Unique: jVRkQXmENYmuaJeQNQFPNw-1 X-Mimecast-MFC-AGG-ID: jVRkQXmENYmuaJeQNQFPNw_1773938223 To: devel@lists.libvirt.org Subject: [libvirt PATCH 04/11] qemu: Expand call to qemuDomainNeedsVFIO Date: Thu, 19 Mar 2026 17:36:50 +0100 Message-ID: <7f13878fd7ac905dde4ed6babd35778afad04b2e.1773938045.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lyCS3CBSWBVDVyjQVOfAHLVQAEfrjyZ2wHNNHFEnBok_1773938223 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Q7KMVWWWYTILWZ5LHNNQOUWTLYKEKDBD X-Message-ID-Hash: Q7KMVWWWYTILWZ5LHNNQOUWTLYKEKDBD X-MailFrom: phrdina@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Pavel Hrdina via Devel Reply-To: Pavel Hrdina X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1773938486863154100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Pavel Hrdina The function qemuDomainNeedsVFIO() was originally used by other parts of qemu code to figure out if the VM needs /dev/vfio/vfio. Later it was also used by code calculating locked memory limit for all architectures, and after that change again and used only for PPC64. Now it needs to be changed again due to IOMMUFD support, the /dev/vfio/vfio device is used by QEMU only if IOMMUFD is not used but for accounting we should most likely still consider any PCI host device. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_domain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 90d0f02612..4520c3c28d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8259,7 +8259,10 @@ getPPC64MemLockLimitBytes(virDomainDef *def) passthroughLimit =3D maxMemory + 128 * (1ULL<<30) / 512 * nPCIHostBridges + 8192; - } else if (qemuDomainNeedsVFIO(def) || virDomainDefHasVDPANet(def)) { + } else if (virDomainDefHasPCIHostdev(def) || + virDomainDefHasMdevHostdev(def) || + virDomainDefHasNVMeDisk(def) || + virDomainDefHasVDPANet(def)) { /* For regular (non-NVLink2 present) VFIO passthrough, the value * of passthroughLimit is: * --=20 2.53.0