From nobody Mon Sep 14 04:51:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1788942865; cv=none; d=zohomail.com; s=zohoarc; b=JqBaFPle7GtE9DKcTE1Cspp2qnvaag0z3Qe2pIxE7Vf5CTWDlwZIvAb1Jp2z072zrKt1oBmhfcgeessKdWEM4jRoCKbDvmNXJndeX3HdpymifGV2xsNBPwudHF+ssBTgZX4otTGE5zncNIjSmmdqSlg/AOtJZVP0e5XHhtHhJbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788942865; h=Content-Transfer-Encoding:Cc:Cc: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:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=2n8vcXcZAZV8j2EgXPSckxVPh/FsRKTgeGh5cLHmQUA=; b=Kl68EAstRJMPXBb6hgINvUur4Z62EE5JVrd9wtbJmPoQ49qWuSUpe8pskEetrMZ2maKZcPgMovcqPIRUqxkpXcIUTgflR3NUsgPnaAGpGDMQqZebS+hRYcdMlQWtDo4lTfmZ5WsVeldOpacZL2OvxFPv9L1yOlKpIb4hoWXu4zI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1788942865459766.1748585680319; Wed, 9 Sep 2026 01:34:25 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 9F7063FD1D; Wed, 9 Sep 2026 04:34:23 -0400 (EDT) Received: from [172.19.199.13] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id CE5F34190E for ; Wed, 9 Sep 2026 04:31:39 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8DD7B3F836; Wed, 9 Sep 2026 04:31:17 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AF3B13F323 for ; Wed, 9 Sep 2026 04:31:15 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2026 01:30:09 -0700 Received: from unknown (HELO gnr-sp-2s-612.sh.intel.com) ([10.112.229.148]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2026 01:30:08 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788942676; x=1820478676; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xB+JSrr5cgPtxLj/WJARTF8pYfG6oXEIdzRUKrBevMQ=; b=S716MZXcaHSSJVYT2SXloLkXQ476EDRYiSMHUg0h2yNLbdc3UzMQE/// 2xURyh7BsEF0YWtNicyx/a9i7uskR5aBuoMH4id42juANZeu0qIS0oc+K hyjqbmmPT3fi0oEn298NNVs1n5tcz5Fzf1/o9641eeErhzJqThVH6iZ2Z u1oWS7zVZjfJfT/piL9LQiojqjMss7vde2ywOnaa7TCzZno0yMIbZ5Juu LjceYK68i7JCXVhEg9/7mojPUDxK79yJSZ2aIT0e2ZpyDL0Ekxi9GNkWv 3ViEleGWjauhd42Z/ms3LxjW9Amj4KvhA8PG4OlyBP7KmW7OtmxFLPy6L Q==; X-CSE-ConnectionGUID: 5vh7YvUDQFmH4YSJ+Kye6Q== X-CSE-MsgGUID: VlcTt37lS1qVY8HRi9O50A== X-IronPort-AV: E=McAfee;i="6800,10657,11900"; a="93178892" X-IronPort-AV: E=Sophos;i="6.25,270,1779174000"; d="scan'208";a="93178892" X-CSE-ConnectionGUID: d01cbkp5SamKwwRuzrx2sA== X-CSE-MsgGUID: FVvNKSI9TFm3ahjtjbD61A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,270,1779174000"; d="scan'208";a="309519007" From: Zhenzhong Duan To: devel@lists.libvirt.org Subject: [PATCH v2 01/12] qemu_capabilities: Introduce QEMU_CAPS_INTEL_IOMMU_SCALABLE_MODE Date: Wed, 9 Sep 2026 16:29:48 +0800 Message-ID: <20260909082959.3191720-2-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260909082959.3191720-1-zhenzhong.duan@intel.com> References: <20260909082959.3191720-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: A2CLCVA37Z55NJJZWCVCD3XC72PTQUCB X-Message-ID-Hash: A2CLCVA37Z55NJJZWCVCD3XC72PTQUCB X-MailFrom: zhenzhong.duan@intel.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 CC: Zhenzhong Duan 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: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1788942867257158500 Content-Type: text/plain; charset="utf-8" This capability tracks whether intel-iommu device has scalable-mode attribute. Signed-off-by: Zhenzhong Duan Reviewed-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bc2b0412dc..209356a984 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -776,6 +776,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "arm-smmuv3.cmdqv", /* QEMU_CAPS_ARM_SMMUV3_CMDQV */ "iothread.poll-weight", /* QEMU_CAPS_IOTHREAD_POLL_WEIGHT */ "win-dmp.guest-aware", /* QEMU_CAPS_WIN_DMP_GUEST_AWARE */ + "intel-iommu.scalable-mode", /* QEMU_CAPS_INTEL_IOMMU_SCALAB= LE_MODE */ ); =20 =20 @@ -1619,6 +1620,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCaps= DevicePropsIntelIOMMU[] =3D { { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB, NULL }, { "aw-bits", QEMU_CAPS_INTEL_IOMMU_AW_BITS, NULL }, { "dma-translation", QEMU_CAPS_INTEL_IOMMU_DMA_TRANSLATION, NULL }, + { "scalable-mode", QEMU_CAPS_INTEL_IOMMU_SCALABLE_MODE, NULL }, }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsMCH[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 28303fd8f0..25695d7982 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -750,6 +750,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_ARM_SMMUV3_CMDQV, /* arm-smmuv3.cmdqv */ QEMU_CAPS_IOTHREAD_POLL_WEIGHT, /* -object iothread.poll-weight */ QEMU_CAPS_WIN_DMP_GUEST_AWARE, /* 'win-dmp' is offered only to a guest= that can use it */ + QEMU_CAPS_INTEL_IOMMU_SCALABLE_MODE, /* intel-iommu.scalable-mode */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml b/tests/qemu= capabilitiesdata/caps_11.1.0_x86_64.xml index 05e6749a17..e228b0f3d1 100644 --- a/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml @@ -224,6 +224,7 @@ + 11001000 43100287 v11.1.0 --=20 2.52.0 From nobody Mon Sep 14 04:51:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1788943442; cv=none; d=zohomail.com; s=zohoarc; b=RzdTVD1OEQPaABjR6rjzXc1UCXcS8b86pEjFGdxArR77Wo5m1Rf7yrE+oAwXJhK3QgNgd4f4YDFvSFJfyBPAU0hIG5WegfQnB/DB/chJPiDulxl1w77GYYZo6/8o7BNrOTmqc1hthZ6nTwQ29btLSJhxbzVvnTI5gyRitG9gsFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788943442; h=Content-Transfer-Encoding:Cc:Cc: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:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=B7Tf/X3hR4CO1lFTFHjeD85XdlVqJb7A+u/72WzOKbE=; b=RKiJ58lwG3Gjv8UGz2c5GEpthu4Zui38SHFWZypvMZZmyUYEXBYbE/iL/AQ8swlouo2EBJmIag6kebHQAfvf5A33KS4Yqz6to3nsrtGR5SRW48IpOFHtTJkkZJjTmzHEvDaHBol72L0/qvDDK3TdKkg0stIAC8L2YGNx8hyojbY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1788943442090137.90449601595617; Wed, 9 Sep 2026 01:44:02 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7FC0E4193C; Wed, 9 Sep 2026 04:44:00 -0400 (EDT) Received: from [172.19.199.13] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 4585F41C86 for ; Wed, 9 Sep 2026 04:32:22 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id F2BD03F2F4; Wed, 9 Sep 2026 04:31:20 -0400 (EDT) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 65A413F377 for ; Wed, 9 Sep 2026 04:31:16 -0400 (EDT) Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2026 01:30:11 -0700 Received: from unknown (HELO gnr-sp-2s-612.sh.intel.com) ([10.112.229.148]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2026 01:30:09 -0700 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788942676; x=1820478676; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hn2jenAEhcwcABObAuwe3jrq7GE75Ob6GTqvNq5Unyc=; b=UUIQimOQW910IWYi0iuf4qzkOtf9riuSSesMgi2sSjGrUcM7hAMjipMY n4ETyGl1uoK/BJFOUH9b1YBCpvfwhxAwYddN/TtT0u4sYkae4XRyCT1DB S/7J0VjrlfPwouQWiY/iQ/AgJOcjoVaVeR+WKCqBkMFeEg8Hdio/eUudU jt1yC7hzwVwX3A2xfLSLGXZN0hpbLS6lHtxijbNl5ckXMMV6c0Ps9l4bg Sw5bkeaUSbOiskAbeP5M+nk8UHAZf3bPA5DolukXnVkw02mJUW36A9luU 0dwjHQKtgZABqlqk3l41DTIItas2LOAhKqWB+HlkXyMhJlcSQr+FgASky A==; X-CSE-ConnectionGUID: lPlvAdMLRmK+G8Hhxx0nXw== X-CSE-MsgGUID: tQGrhsJoS4ysrua5/E2bBA== X-IronPort-AV: E=McAfee;i="6800,10657,11900"; a="93178894" X-IronPort-AV: E=Sophos;i="6.25,270,1779174000"; d="scan'208";a="93178894" X-CSE-ConnectionGUID: p2pYIl97SGq0OBn3NRqk4A== X-CSE-MsgGUID: jzAdOryXQV2iT9ZkIzugyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,270,1779174000"; d="scan'208";a="309519017" From: Zhenzhong Duan To: devel@lists.libvirt.org Subject: [PATCH v2 02/12] conf: Add scalable_mode attribute to iommu Date: Wed, 9 Sep 2026 16:29:49 +0800 Message-ID: <20260909082959.3191720-3-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260909082959.3191720-1-zhenzhong.duan@intel.com> References: <20260909082959.3191720-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BDWANYLH5VUKX22Z2OE54DGHBHBPSWLG X-Message-ID-Hash: BDWANYLH5VUKX22Z2OE54DGHBHBPSWLG X-MailFrom: zhenzhong.duan@intel.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 CC: Zhenzhong Duan 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: X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1788943442996158500 Content-Type: text/plain; charset="utf-8" Add scalable_mode attribute to iommu to enable/disable scalable mode for intel-iommu. Signed-off-by: Zhenzhong Duan --- docs/formatdomain.rst | 4 ++ src/conf/domain_conf.c | 16 ++++++++ src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 3 ++ src/conf/schemas/domaincommon.rng | 5 +++ src/qemu/qemu_validate.c | 8 +++- ...tel-iommu-scalable-mode.x86_64-latest.args | 34 +++++++++++++++++ ...ntel-iommu-scalable-mode.x86_64-latest.xml | 37 +++++++++++++++++++ .../intel-iommu-scalable-mode.xml | 37 +++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 10 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-= latest.args create mode 100644 tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-= latest.xml create mode 100644 tests/qemuxmlconfdata/intel-iommu-scalable-mode.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 5a278f3717..761c5747ed 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -9482,6 +9482,10 @@ Examples: default value is used. :since:`Since 12.7.0` (QEMU/KVM and ``smmuv3`` model only) =20 + ``scalable_mode`` + Enable scalable mode DMA translation. + :since:`Since 12.8.0` (QEMU/KVM and ``intel`` model only) + In case of ``virtio`` IOMMU device, the ``driver`` element can optionally contain ``granule`` subelement that allows to choose which granule will be used by default. It is useful when running guests with different page size diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 34d3b00079..5bcc646deb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14778,6 +14778,10 @@ virDomainIOMMUDefParseXML(virDomainXMLOption *xmlo= pt, &iommu->oas, -1) < 0) return NULL; =20 + if (virXMLPropTristateSwitch(driver, "scalable_mode", VIR_XML_PROP= _NONE, + &iommu->scalable_mode) < 0) + return NULL; + if ((granule =3D virXPathNode("./driver/granule", ctxt))) { g_autofree char *mode =3D virXMLPropString(granule, "mode"); unsigned long long size; @@ -16888,6 +16892,7 @@ virDomainIOMMUDefEquals(const virDomainIOMMUDef *a, a->ril !=3D b->ril || a->ssid_size !=3D b->ssid_size || a->oas !=3D b->oas || + a->scalable_mode !=3D b->scalable_mode || a->xtsup !=3D b->xtsup || a->pt !=3D b->pt || a->granule !=3D b->granule) @@ -22823,6 +22828,13 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUD= ef *src, virTristateSwitchTypeToString(src->dma_translation)= ); return false; } + if (src->scalable_mode !=3D dst->scalable_mode) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain IOMMU device scalable mode '%1$s' = does not match source '%2$s'"), + virTristateSwitchTypeToString(dst->scalable_mode), + virTristateSwitchTypeToString(src->scalable_mode)); + return false; + } if (src->pt !=3D dst->pt) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target domain IOMMU device passthrough '%1$s' do= es not match source '%2$s'"), @@ -29278,6 +29290,10 @@ virDomainIOMMUDefFormat(virBuffer *buf, virBufferAsprintf(&driverAttrBuf, " dma_translation=3D'%s'", virTristateSwitchTypeToString(iommu->dma_transla= tion)); } + if (iommu->scalable_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&driverAttrBuf, " scalable_mode=3D'%s'", + virTristateSwitchTypeToString(iommu->scalable_mo= de)); + } if (iommu->pt !=3D VIR_TRISTATE_SWITCH_ABSENT) { virBufferAsprintf(&driverAttrBuf, " passthrough=3D'%s'", virTristateSwitchTypeToString(iommu->pt)); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3732525af4..2c23a3f65a 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3104,6 +3104,7 @@ struct _virDomainIOMMUDef { int pci_bus; virDomainDeviceInfo info; virTristateSwitch dma_translation; + virTristateSwitch scalable_mode; virTristateSwitch xtsup; virTristateSwitch pt; int granule; /* -1 means 'host', 0 unset, page size in KiB otherwise */ diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 15e3bb29e6..10318d89ee 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -3202,6 +3202,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *io= mmu) iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->aw_bits !=3D 0 || iommu->dma_translation !=3D VIR_TRISTATE_SWITCH_ABSENT || + iommu->scalable_mode !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->xtsup !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->pt !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->granule !=3D 0) { @@ -3228,6 +3229,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *io= mmu) iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->dma_translation !=3D VIR_TRISTATE_SWITCH_ABSENT || + iommu->scalable_mode !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->pci_bus >=3D 0 || iommu->accel !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->cmdqv !=3D VIR_TRISTATE_SWITCH_ABSENT || @@ -3256,6 +3258,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *io= mmu) iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->aw_bits !=3D 0 || iommu->dma_translation !=3D VIR_TRISTATE_SWITCH_ABSENT || + iommu->scalable_mode !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->pci_bus >=3D 0 || iommu->accel !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->cmdqv !=3D VIR_TRISTATE_SWITCH_ABSENT || diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 887fb8f808..01b1766150 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -6424,6 +6424,11 @@ + + + + + diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e946f55351..55513b2691 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5815,7 +5815,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMU= Def *iommu, return -1; } if (iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) { + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("iommu: caching mode is not supported with this Q= EMU binary")); return -1; @@ -5843,6 +5843,12 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMM= UDef *iommu, _("iommu: updating dma translation is not supported= with this QEMU binary")); return -1; } + if (iommu->scalable_mode !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_SCALABLE_MODE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iommu: scalable mode is not supported with this = QEMU binary")); + return -1; + } =20 /* While QEMU_CAPS_ARM_SMMUV3_ACCEL tracks the .accel attribute of * arm-smmuv3 it is also a good indicator of .ats, .ril, .ssidsize, and diff --git a/tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-latest.= args b/tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-latest.args new file mode 100644 index 0000000000..c12d76bd89 --- /dev/null +++ b/tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine q35,usb=3Doff,kernel_irqchip=3Dsplit,dump-guest-core=3Doff,memory= -backend=3Dpc.ram,acpi=3Doff \ +-accel kvm \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D@mon-fd@,server=3Don,wait=3Doff \ +-object '{"qom-type":"monitor-qmp","id":"monitor","chardev":"charmonitor"}= ' \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device '{"driver":"intel-iommu","id":"iommu0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=3Doff \ +-watchdog-action reset \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-latest.= xml b/tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-latest.xml new file mode 100644 index 0000000000..a8f044ee12 --- /dev/null +++ b/tests/qemuxmlconfdata/intel-iommu-scalable-mode.x86_64-latest.xml @@ -0,0 +1,37 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + +
+ + + +