From nobody Mon Dec 15 01:39:01 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 1495098812077644.7909327044968; Thu, 18 May 2017 02:13:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36A5980C01; Thu, 18 May 2017 09:13:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 123D9627DD; Thu, 18 May 2017 09:13:29 +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 AE2C24BB7F; Thu, 18 May 2017 09:13:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4I9Bsrv021332 for ; Thu, 18 May 2017 05:11:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3440B5C891; Thu, 18 May 2017 09:11:54 +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 848815C88F; Thu, 18 May 2017 09:11:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 36A5980C01 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.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 36A5980C01 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 18 May 2017 11:09:31 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: rkrcmar@redhat.com Subject: [libvirt] [PATCH 1/2] conf: add eim attribute to 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 18 May 2017 09:13:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add an attribute to control extended interrupt mode. https://bugzilla.redhat.com/show_bug.cgi?id=3D1451282 Reviewed-by: Andrea Bolognani --- docs/formatdomain.html.in | 10 +++++++ docs/schemas/domaincommon.rng | 5 ++++ src/conf/domain_conf.c | 20 ++++++++++++++ src/conf/domain_conf.h | 1 + .../qemuxml2argv-intel-iommu-eim.xml | 31 ++++++++++++++++++= ++++ .../qemuxml2xmlout-intel-iommu-eim.xml | 1 + tests/qemuxml2xmltest.c | 1 + 7 files changed, 69 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim= .xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 3135db4..b5026b1 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7436,6 +7436,16 @@ qemu-kvm -net nic,model=3D? /dev/null Since 3.4.0 (QEMU/KVM only)

+
eim
+
+

+ The eim attribute with possible values + on and off can be used to + turn on extended interrupt mode. In combination with intremap + and split I/O APIC, this allows for more vCPUs to be used. + Since 3.4.0 (QEMU/KVM only) +

+
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index f88e84a..144c281 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3959,6 +3959,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9eba70a..2264d96 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14184,6 +14184,14 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, } iommu->caching_mode =3D val; } + VIR_FREE(tmp); + if ((tmp =3D virXPathString("string(./driver/@eim)", ctxt))) { + if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_XML_ERROR, _("unknown eim value: %s"), = tmp); + goto cleanup; + } + iommu->eim =3D val; + } =20 ret =3D iommu; iommu =3D NULL; @@ -19856,6 +19864,14 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUD= efPtr src, virTristateSwitchTypeToString(src->caching_mode)); return false; } + if (src->eim !=3D dst->eim) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain IOMMU device eim value '%s' " + "does not match source '%s'"), + virTristateSwitchTypeToString(dst->eim), + virTristateSwitchTypeToString(src->eim)); + return false; + } return true; } =20 @@ -24199,6 +24215,10 @@ virDomainIOMMUDefFormat(virBufferPtr buf, virBufferAsprintf(&childBuf, " caching_mode=3D'%s'", virTristateSwitchTypeToString(iommu->caching= _mode)); } + if (iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, " eim=3D'%s'", + virTristateSwitchTypeToString(iommu->eim)); + } virBufferAddLit(&childBuf, "/>\n"); } =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 34a3596..83e0672 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2211,6 +2211,7 @@ struct _virDomainIOMMUDef { virDomainIOMMUModel model; virTristateSwitch intremap; virTristateSwitch caching_mode; + virTristateSwitch eim; }; /* * Guest VM main configuration diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml b/test= s/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml new file mode 100644 index 0000000..8642ed3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml @@ -0,0 +1,31 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 288 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml b/= tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml new file mode 120000 index 0000000..9fbec36 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index fed74d0..fff13e2 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1127,6 +1127,7 @@ mymain(void) QEMU_CAPS_MACHINE_IOMMU); DO_TEST("intel-iommu-ioapic", NONE); DO_TEST("intel-iommu-caching-mode", NONE); + DO_TEST("intel-iommu-eim", 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