From nobody Mon Feb 2 07:31:48 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; 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=1769013171; cv=none; d=zohomail.com; s=zohoarc; b=n0kjUgfgfRdiNddrcfDInkULaG4q38jHIdWr/LSXJOrSoDu/Ht/35u1wYDGKII0Fq2El+i00lBK0vWK8DZgTrZIZbTI4Qan4fSRGuezcUUEBDRBhthYfHjSKmpMSzNinAxODQEgN4v9vFSI0c+XhX5JeqAhf09558T9F+j0YCa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769013171; 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=LcgkXPSNLDyNkY9rwbieQrkWXCInpghM8bC6g0c2DGk=; b=UyjxCAisGfqatGuhsFZ6uyN+vknATacevai79StAhmhW5dXd98rjrfFnZzhVUkTm4aFLkEZx3P0kCsc4MZBZVMR85xYoWrBDttJCLhpHb9yWx6f619xOux81srUjdKzfM+3iRX3EEUyaw9fjINT1j8V/p8QNdaa0VPHmolJg3Lc= 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 1769013171902666.5025321965092; Wed, 21 Jan 2026 08:32:51 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0CA7B41B9A; Wed, 21 Jan 2026 11:32:51 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 255A243F7D; Wed, 21 Jan 2026 11:28:13 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2230641A49; Wed, 21 Jan 2026 11:28:08 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 173D041BA8 for ; Wed, 21 Jan 2026 11:27:33 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-0ua0jffVPMew2gwtrT8ZGA-1; Wed, 21 Jan 2026 11:27:31 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8970B18002C4 for ; Wed, 21 Jan 2026 16:27:30 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E3F2119560A7 for ; Wed, 21 Jan 2026 16:27:29 +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=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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=1769012852; 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=LcgkXPSNLDyNkY9rwbieQrkWXCInpghM8bC6g0c2DGk=; b=fQRo2ykYVfePRo+F29yu95WKPaXwH8u5/LZBIu9GrgbkgvJRiwno8vD79E74Mbh46tvN8+ Ob6avM1A03seGpq05pq70llM15yg7LwsHo+GMReIMPIm+3cVARrXsLBi9rrvRMZZehAxvx Em8kcTWbNlcs9zFLajUhjOnaSO7iO8o= X-MC-Unique: 0ua0jffVPMew2gwtrT8ZGA-1 X-Mimecast-MFC-AGG-ID: 0ua0jffVPMew2gwtrT8ZGA_1769012850 To: devel@lists.libvirt.org Subject: [PATCH 5/6] qemu_validate: Check whether granule of virtio-iommu is supported Date: Wed, 21 Jan 2026 17:27:21 +0100 Message-ID: <13ce432f40ed407257c3007faa4702da489b979b.1769012588.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: pj5iP0VP6PdBaAiBgsiOMTTvaNE-syOB9UOptveHkgI_1769012850 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WUVXGKCAQ36KJK2XE4KYNWHH6FNOSQB3 X-Message-ID-Hash: WUVXGKCAQ36KJK2XE4KYNWHH6FNOSQB3 X-MailFrom: mprivozn@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: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769013173632158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Just like with other features, check whether QEMU supports them based on capabilities. Now, instead of inventing a new QEMU capability, an existing one can be used: QEMU_CAPS_VIRTIO_IOMMU_AW_BITS. This is because the aw-bits and granule attributes were introduced into QEMU in close succession (v9.0.0-rc0~9^2~7 v9.0.0-rc0~9^2~11), neither can be disabled at compile time and backporting just one without the other makes almost no sense. Signed-off-by: Michal Privoznik --- src/qemu/qemu_validate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ab8a1938c1..f5072941c5 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5684,6 +5684,12 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMM= UDef *iommu, _("iommu: updating dma translation is not supported= with this QEMU binary")); return -1; } + if (iommu->granule_mode !=3D VIR_DOMAIN_IOMMU_GRANULE_MODE_NONE && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_IOMMU_AW_BITS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iommu: page granule is not supported with this Q= EMU binary")); + return -1; + } =20 return 0; } --=20 2.52.0