From nobody Sun Dec 14 06:20:46 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 1493820476939229.2040567158832; Wed, 3 May 2017 07:07:56 -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 4DBAC4E356; Wed, 3 May 2017 14:07:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07183182C9; Wed, 3 May 2017 14:07:53 +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 AED955EC62; Wed, 3 May 2017 14:07:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v43E7p5V014338 for ; Wed, 3 May 2017 10:07:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3648A17F57; Wed, 3 May 2017 14:07:51 +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 7A7DD17F5D; Wed, 3 May 2017 14:07:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4DBAC4E356 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.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 4DBAC4E356 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 3 May 2017 16:05:14 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: peterx@redhat.com Subject: [libvirt] [PATCHv4 1/6] conf: add 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.38]); Wed, 03 May 2017 14:07:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add a new element with a driver attribute. Possible values are qemu and kvm. With 'qemu', the I/O APIC can be put in the userspace even for KVM domains. https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- docs/formatdomain.html.in | 8 ++++++ docs/schemas/domaincommon.rng | 15 ++++++++++ src/conf/domain_conf.c | 33 ++++++++++++++++++= +++- src/conf/domain_conf.h | 11 ++++++++ .../qemuxml2argv-intel-iommu-ioapic.xml | 29 +++++++++++++++++++ .../qemuxml2xmlout-intel-iommu-ioapic.xml | 1 + tests/qemuxml2xmltest.c | 1 + 7 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.= xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioa= pic.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8c884f4..6669e71 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1678,6 +1678,7 @@ </kvm> <pvspinlock state=3D'on'/> <gic version=3D'2'/> + <ioapic driver=3D'qemu'/> =20 </features> ... @@ -1839,6 +1840,13 @@ for hypervisor to decide. Since 2.1.0 +
ioapic
+
Tune the I/O APIC. Possible values for the + driver attribute are: + kvm (default for KVM domains) + and qemu which puts I/O APIC in userspace. + Since 3.4.0 (KVM only) +
=20

Time keeping

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 281309e..64f718b 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4569,6 +4569,9 @@ + + + @@ -4747,6 +4750,18 @@ =20 + + + + + qemu + kvm + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0ff216e..29b04d3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -141,7 +141,8 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "pmu", "vmport", "gic", - "smm") + "smm", + "ioapic") =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_= LAST, "default", @@ -859,6 +860,11 @@ VIR_ENUM_IMPL(virDomainLoader, "rom", "pflash") =20 +VIR_ENUM_IMPL(virDomainIOAPIC, + VIR_DOMAIN_IOAPIC_LAST, + "qemu", + "kvm") + /* Internal mapping: subset of block job types that can be present in * XML (remaining types are not two-phase). */ VIR_ENUM_DECL(virDomainBlockJob) @@ -17527,6 +17533,24 @@ virDomainDefParseXML(xmlDocPtr xml, ctxt->node =3D node; break; =20 + case VIR_DOMAIN_FEATURE_IOAPIC: + node =3D ctxt->node; + ctxt->node =3D nodes[i]; + tmp =3D virXPathString("string(./@driver)", ctxt); + if (tmp) { + int value =3D virDomainIOAPICTypeFromString(tmp); + if (value < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown driver mode: %s"), + tmp); + goto error; + } + def->ioapic =3D value; + def->features[val] =3D VIR_TRISTATE_SWITCH_ON; + } + ctxt->node =3D node; + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; @@ -24627,6 +24651,13 @@ virDomainDefFormatInternal(virDomainDefPtr def, } break; =20 + case VIR_DOMAIN_FEATURE_IOAPIC: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { + virBufferAsprintf(buf, "\n", + virDomainIOAPICTypeToString(def->ioa= pic)); + } + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 09fb7aa..82b4785 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1670,6 +1670,7 @@ typedef enum { VIR_DOMAIN_FEATURE_VMPORT, VIR_DOMAIN_FEATURE_GIC, VIR_DOMAIN_FEATURE_SMM, + VIR_DOMAIN_FEATURE_IOAPIC, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1809,6 +1810,15 @@ struct _virDomainLoaderDef { =20 void virDomainLoaderDefFree(virDomainLoaderDefPtr loader); =20 +typedef enum { + VIR_DOMAIN_IOAPIC_QEMU =3D 0, + VIR_DOMAIN_IOAPIC_KVM, + + VIR_DOMAIN_IOAPIC_LAST +} virDomainIOAPIC; + +VIR_ENUM_DECL(virDomainIOAPIC); + /* Operating system configuration data & machine / arch */ typedef struct _virDomainOSDef virDomainOSDef; typedef virDomainOSDef *virDomainOSDefPtr; @@ -2258,6 +2268,7 @@ struct _virDomainDef { unsigned int hyperv_spinlocks; virGICVersion gic_version; char *hyperv_vendor_id; + virDomainIOAPIC ioapic; =20 /* These options are of type virTristateSwitch: ON =3D keep, OFF =3D d= rop */ int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST]; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml new file mode 100644 index 0000000..284d63a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml @@ -0,0 +1,29 @@ + + 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-ioapic.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml new file mode 120000 index 0000000..42d17b2 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 2dccde7..0f00b20 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1122,6 +1122,7 @@ mymain(void) DO_TEST("intel-iommu-machine", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_IOMMU); + DO_TEST("intel-iommu-ioapic", 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