From nobody Tue Dec 16 11:06:23 2025
Delivered-To: importer@patchew.org
Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28
as permitted sender) client-ip=209.132.183.28;
envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com;
Authentication-Results: mx.zoho.com;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
Return-Path:
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by
mx.zohomail.com
with SMTPS id 149674921854251.77702479661116;
Tue, 6 Jun 2017 04:40:18 -0700 (PDT)
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com
[10.5.11.16])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id C96218046D;
Tue, 6 Jun 2017 11:40:10 +0000 (UTC)
Received: from colo-mx.corp.redhat.com
(colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20])
by smtp.corp.redhat.com (Postfix) with ESMTPS id A16895C888;
Tue, 6 Jun 2017 11:40:10 +0000 (UTC)
Received: from lists01.pubmisc.prod.ext.phx2.redhat.com
(lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33])
by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4D29A180BAFD;
Tue, 6 Jun 2017 11:39:52 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com
[10.5.11.12])
by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
id v56Bck6Z001888 for ;
Tue, 6 Jun 2017 07:38:46 -0400
Received: by smtp.corp.redhat.com (Postfix)
id 93B80756BF; Tue, 6 Jun 2017 11:38:46 +0000 (UTC)
Received: from icr.brq.redhat.com (dhcp129-58.brq.redhat.com [10.34.129.58])
by smtp.corp.redhat.com (Postfix) with ESMTP id 19DF87ED85
for ; Tue, 6 Jun 2017 11:38:45 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C96218046D
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com
DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C96218046D
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Tue, 6 Jun 2017 13:36:17 +0200
Message-Id:
<8e7c2022d19a9bc1658e07d60212bf4d2139bd33.1496748930.git.jtomko@redhat.com>
In-Reply-To:
References:
In-Reply-To:
References:
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-loop: libvir-list@redhat.com
Subject: [libvirt] [PATCHv2 03/15] conf: add device_iotlb attribute to iommu
X-BeenThere: libvir-list@redhat.com
X-Mailman-Version: 2.1.12
Precedence: junk
List-Id: Development discussions about the libvirt library & tools
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Sender: libvir-list-bounces@redhat.com
Errors-To: libvir-list-bounces@redhat.com
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]);
Tue, 06 Jun 2017 11:40:11 +0000 (UTC)
X-ZohoMail: RSF_0 Z_629925259 SPT_0
Content-Type: text/plain; charset="utf-8"
Add a new device_iotlb attribute to the iommu device
to control the device IOTLB support for intel-iommu.
https://bugzilla.redhat.com/show_bug.cgi?id=3D1283251
---
docs/formatdomain.html.in | 9 +++++++
docs/schemas/domaincommon.rng | 5 ++++
src/conf/domain_conf.c | 15 ++++++++++-
src/conf/domain_conf.h | 1 +
.../qemuxml2argv-intel-iommu-device-iotlb.xml | 31 ++++++++++++++++++=
++++
.../qemuxml2xmlout-intel-iommu-device-iotlb.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
7 files changed, 62 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-=
iotlb.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-dev=
ice-iotlb.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 07208ee..2f1e030 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7449,6 +7449,15 @@ qemu-kvm -net nic,model=3D? /dev/null
Since 3.4.0 (QEMU/KVM only)
+ device_iotlb
+
+
+ The device_iotlb attribute with possible values
+ on and off can be used to
+ turn on the device IOTLB descriptor.
+ Since 3.5.0 (QEMU/KVM only)
+
+
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4d9f8d1..6c3e885 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3964,6 +3964,11 @@
[
+
+
+ ][
+ ]
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e50628f..89c8917 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14208,6 +14208,14 @@ virDomainIOMMUDefParseXML(xmlNodePtr node,
}
iommu->caching_mode =3D val;
}
+ VIR_FREE(tmp);
+ if ((tmp =3D virXPathString("string(./driver/@device_iotlb)", ctxt))) {
+ if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_XML_ERROR, _("unknown device_iotlb valu=
e: %s"), tmp);
+ goto cleanup;
+ }
+ iommu->device_iotlb =3D val;
+ }
=20
VIR_FREE(tmp);
if ((tmp =3D virXPathString("string(./driver/@eim)", ctxt))) {
@@ -24258,7 +24266,8 @@ virDomainIOMMUDefFormat(virBufferPtr buf,
virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2);
=20
if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT ||
- iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) {
+ iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT ||
+ iommu->device_iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT) {
virBufferAddLit(&childBuf, "intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) {
virBufferAsprintf(&childBuf, " intremap=3D'%s'",
@@ -24272,6 +24281,10 @@ virDomainIOMMUDefFormat(virBufferPtr buf,
virBufferAsprintf(&childBuf, " eim=3D'%s'",
virTristateSwitchTypeToString(iommu->eim));
}
+ if (iommu->device_iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&childBuf, " device_iotlb=3D'%s'",
+ virTristateSwitchTypeToString(iommu->device_=
iotlb));
+ }
virBufferAddLit(&childBuf, "/>\n");
}
=20
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 446b117..7d1f05c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2212,6 +2212,7 @@ struct _virDomainIOMMUDef {
virTristateSwitch intremap;
virTristateSwitch caching_mode;
virTristateSwitch eim;
+ virTristateSwitch device_iotlb;
};
/*
* Guest VM main configuration
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.x=
ml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml
new file mode 100644
index 0000000..0cdf2aa
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml
@@ -0,0 +1,31 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-x86_64
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iot=
lb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iotlb.x=
ml
new file mode 120000
index 0000000..3120d9f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iotlb.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index fff13e2..5e8cead 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1128,6 +1128,7 @@ mymain(void)
DO_TEST("intel-iommu-ioapic", NONE);
DO_TEST("intel-iommu-caching-mode", NONE);
DO_TEST("intel-iommu-eim", NONE);
+ DO_TEST("intel-iommu-device-iotlb", NONE);
=20
DO_TEST("cpu-check-none", NONE);
DO_TEST("cpu-check-partial", NONE);
--=20
2.10.2
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list