From nobody Fri May 3 14:56:44 2024 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 From nobody Fri May 3 14:56:44 2024 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 1493820480318739.4715461252375; Wed, 3 May 2017 07:08:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E119F3D954; Wed, 3 May 2017 14:07:57 +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 BEC9117D64; Wed, 3 May 2017 14:07:57 +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 7666418523D4; Wed, 3 May 2017 14:07:57 +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 v43E7q5J014344 for ; Wed, 3 May 2017 10:07:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6DEE517F2C; Wed, 3 May 2017 14:07:52 +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 8A84417F4B; Wed, 3 May 2017 14:07:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E119F3D954 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.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 E119F3D954 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 3 May 2017 16:05:15 +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 2/6] qemu: format kernel_irqchip on the command line 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 03 May 2017 14:07:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add kernel_irqchip=3Dsplit/on to the QEMU command line and a capability that looks for it in query-command-line-options output. For the 'split' option, use a version check since it cannot be reasonably probed. https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- src/qemu/qemu_capabilities.c | 8 +++++++ src/qemu/qemu_capabilities.h | 4 ++++ src/qemu/qemu_command.c | 25 ++++++++++++++++++= ++++ tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + .../caps_2.6.0-gicv2.aarch64.xml | 2 ++ .../caps_2.6.0-gicv3.aarch64.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 2 ++ tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 2 ++ .../qemuxml2argv-intel-iommu-ioapic.args | 19 ++++++++++++++++ tests/qemuxml2argvtest.c | 5 +++++ 20 files changed, 85 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.= args diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8bc3ea0..9c08912 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -366,6 +366,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-named-block-nodes", "cpu-cache", "qemu-xhci", + + "kernel-irqchip", /* 255 */ + "kernel-irqchip.split", ); =20 =20 @@ -3127,6 +3130,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCaps= CommandLine[] =3D { { "drive", "throttling.bps-total-max-length", QEMU_CAPS_DRIVE_IOTUNE_M= AX_LENGTH }, { "drive", "throttling.group", QEMU_CAPS_DRIVE_IOTUNE_GROUP }, { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, + { "machine", "kernel_irqchip", QEMU_CAPS_MACHINE_KERNEL_IRQCHIP }, }; =20 static int @@ -4739,6 +4743,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >=3D 2004050) virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACH_VIRT_GIC_VERSION); =20 + /* no way to query if -machine kernel_irqchip supports split */ + if (qemuCaps->version >=3D 2006000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 06a43ab..61d3ae2 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -404,6 +404,10 @@ typedef enum { QEMU_CAPS_CPU_CACHE, /* -cpu supports host-cache-info and l3-cache pro= perties */ QEMU_CAPS_DEVICE_QEMU_XHCI, /* -device qemu-xhci */ =20 + /* 255 */ + QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */ + QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=3Ds= plit */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 813a851..2b235c6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7422,6 +7422,31 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } } =20 + if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] =3D=3D VIR_TRISTATE_S= WITCH_ON) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP= )) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("I/O APIC tuning is not supported by this= " + "QEMU binary")); + goto cleanup; + } + switch (def->ioapic) { + case VIR_DOMAIN_IOAPIC_QEMU: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQ= CHIP_SPLIT)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("split I/O APIC is not supported by t= his " + "QEMU binary")); + goto cleanup; + } + virBufferAddLit(&buf, ",kernel_irqchip=3Dsplit"); + break; + case VIR_DOMAIN_IOAPIC_KVM: + virBufferAddLit(&buf, ",kernel_irqchip=3Don"); + break; + case VIR_DOMAIN_IOAPIC_LAST: + break; + } + } + virCommandAddArgBuffer(cmd, &buf); } =20 diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.5.3.x86_64.xml index a68c13b..14f34b2 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml @@ -140,6 +140,7 @@ + 1005003 0 diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.6.0.x86_64.xml index 365b3a6..8fc23d6 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml @@ -145,6 +145,7 @@ + 1006000 0 diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.7.0.x86_64.xml index 689fbf8..47c8956 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml @@ -147,6 +147,7 @@ + 1007000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.1.1.x86_64.xml index e092dd2..afe7d53 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml @@ -163,6 +163,7 @@ + 2001001 0 diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.4.0.x86_64.xml index ea03f2e..5bdc1a2 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -185,6 +185,7 @@ + 2004000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.5.0.x86_64.xml index 164605f..36bc134 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -191,6 +191,7 @@ + 2005000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/test= s/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml index af3a8e7..33bc462 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml @@ -168,6 +168,8 @@ + + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/test= s/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml index 4402ffa..a8ce6b0 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml @@ -168,6 +168,8 @@ + + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemu= capabilitiesdata/caps_2.6.0.ppc64le.xml index 3f05169..425992f 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -162,6 +162,8 @@ + + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.6.0.x86_64.xml index 1d823ea..97e71ec 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -200,6 +200,8 @@ + + 2006000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_2.7.0.s390x.xml index 38d36b3..70cce64 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml @@ -130,6 +130,8 @@ + + 2007000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.7.0.x86_64.xml index 24d7cb4..6c2ea59 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -202,6 +202,8 @@ + + 2007000 0 (v2.7.0) diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_2.8.0.s390x.xml index 42c92c5..51be9bc 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml @@ -132,6 +132,8 @@ + + 2007093 0 diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.8.0.x86_64.xml index 0bc1368..9c8c79a 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -203,6 +203,8 @@ + + 2008000 0 (v2.8.0) diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 2bb889f..3612603 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -210,6 +210,8 @@ + + 2009000 0 (v2.9.0) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args b/= tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args new file mode 100644 index 0000000..43d71ad --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args @@ -0,0 +1,19 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine q35,accel=3Dkvm,kernel_irqchip=3Dsplit \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device intel-iommu diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ce87938..5bc632f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2509,6 +2509,11 @@ mymain(void) DO_TEST("intel-iommu-machine", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_IOMMU); + DO_TEST("intel-iommu-ioapic", + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, + QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, + QEMU_CAPS_DEVICE_INTEL_IOMMU); =20 DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); =20 --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:56:44 2024 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 1493820486293280.63587297723643; Wed, 3 May 2017 07:08:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88E983B71E; Wed, 3 May 2017 14:08:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 597C617F59; Wed, 3 May 2017 14:08:01 +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 11A2D5EC69; Wed, 3 May 2017 14:08:01 +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 v43E7rGH014354 for ; Wed, 3 May 2017 10:07:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9452617F2C; Wed, 3 May 2017 14:07:53 +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 CDB3817F57; Wed, 3 May 2017 14:07:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 88E983B71E Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.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 88E983B71E From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 3 May 2017 16:05:16 +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 3/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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 03 May 2017 14:08:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add a new attribute to control interrupt remapping. https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- docs/formatdomain.html.in | 24 +++++++++++++- docs/schemas/domaincommon.rng | 9 +++++ src/conf/domain_conf.c | 38 ++++++++++++++++++= +--- src/conf/domain_conf.h | 1 + .../qemuxml2argv-intel-iommu-ioapic.xml | 4 ++- 5 files changed, 70 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6669e71..ca98f0e 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7395,7 +7395,9 @@ qemu-kvm -net nic,model=3D? /dev/null
 ...
 <devices>
-  <iommu model=3D'intel'/>
+  <iommu model=3D'intel'>
+    <driver intremap=3D'on'/>
+  </iommu>
 </devices>
 ...
 
@@ -7406,6 +7408,26 @@ qemu-kvm -net nic,model=3D? /dev/null Currently only the intel model is supported.

+
driver
+
+

+ The driver subelement can be used to configure + additional options: +

+
+
intremap
+
+

+ The intremap attribute with possible values + on and off can be used to + turn on interrupt remapping, a part of the VT-d functionalit= y. + Currently this requires split I/O APIC + (<ioapic driver=3D'qemu'/>) + Since 3.4.0 (QEMU/KVM only) +

+
+
+
=20

Security label

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 64f718b..00d9290 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3947,6 +3947,15 @@ intel + + + + + + + + + =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 29b04d3..4eefd92 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14141,12 +14141,16 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode, =20 =20 static virDomainIOMMUDefPtr -virDomainIOMMUDefParseXML(xmlNodePtr node) +virDomainIOMMUDefParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt) { virDomainIOMMUDefPtr iommu =3D NULL, ret =3D NULL; + xmlNodePtr save =3D ctxt->node; char *tmp =3D NULL; int val; =20 + ctxt->node =3D node; + if (VIR_ALLOC(iommu) < 0) goto cleanup; =20 @@ -14163,10 +14167,20 @@ virDomainIOMMUDefParseXML(xmlNodePtr node) =20 iommu->model =3D val; =20 + VIR_FREE(tmp); + if ((tmp =3D virXPathString("string(./driver/@intremap)", ctxt))) { + if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_XML_ERROR, _("unknown intremap value: %= s"), tmp); + goto cleanup; + } + iommu->intremap =3D val; + } + ret =3D iommu; iommu =3D NULL; =20 cleanup: + ctxt->node =3D save; VIR_FREE(iommu); VIR_FREE(tmp); return ret; @@ -14319,7 +14333,7 @@ virDomainDeviceDefParse(const char *xmlStr, goto error; break; case VIR_DOMAIN_DEVICE_IOMMU: - if (!(dev->data.iommu =3D virDomainIOMMUDefParseXML(node))) + if (!(dev->data.iommu =3D virDomainIOMMUDefParseXML(node, ctxt))) goto error; break; case VIR_DOMAIN_DEVICE_NONE: @@ -18449,7 +18463,7 @@ virDomainDefParseXML(xmlDocPtr xml, } =20 if (n > 0) { - if (!(def->iommu =3D virDomainIOMMUDefParseXML(nodes[0]))) + if (!(def->iommu =3D virDomainIOMMUDefParseXML(nodes[0], ctxt))) goto error; } VIR_FREE(nodes); @@ -24125,8 +24139,24 @@ static void virDomainIOMMUDefFormat(virBufferPtr buf, const virDomainIOMMUDef *iommu) { - virBufferAsprintf(buf, "\n", + virBuffer childBuf =3D VIR_BUFFER_INITIALIZER; + + virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2); + + if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, "\n", + virTristateSwitchTypeToString(iommu->intremap)); + } + + virBufferAsprintf(buf, "model)); + if (virBufferUse(&childBuf)) { + virBufferAddLit(buf, ">\n"); + virBufferAddBuffer(buf, &childBuf); + virBufferAddLit(buf, "\n"); + } else { + virBufferAddLit(buf, "/>\n"); + } } =20 =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 82b4785..8eda516 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2209,6 +2209,7 @@ typedef enum { =20 struct _virDomainIOMMUDef { virDomainIOMMUModel model; + virTristateSwitch intremap; }; /* * Guest VM main configuration diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml index 284d63a..bfe714a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml @@ -24,6 +24,8 @@ - + + + --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:56:44 2024 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 1493820484175246.8822280630485; Wed, 3 May 2017 07:08:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D2F780F90; Wed, 3 May 2017 14:07:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CC0677DDF; Wed, 3 May 2017 14:07:59 +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 B6EE95EC66; Wed, 3 May 2017 14:07:58 +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 v43E7sWB014365 for ; Wed, 3 May 2017 10:07:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id A50D817F39; Wed, 3 May 2017 14:07: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 E8A9217F2C; Wed, 3 May 2017 14:07:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D2F780F90 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.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 3D2F780F90 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 3 May 2017 16:05:17 +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 4/6] qemu: format intel-iommu, intremap on the command line 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 03 May 2017 14:08:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- src/qemu/qemu_capabilities.c | 8 ++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 18 ++++++++ .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 22 +++++++--- .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 24 +++++++---- .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 24 +++++++---- .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 28 +++++++++---- tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 37 ++++++++++++---- tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 49 ++++++++++++++++++= ---- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + .../qemuxml2argv-intel-iommu-ioapic.args | 2 +- tests/qemuxml2argvtest.c | 1 + 14 files changed, 173 insertions(+), 44 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9c08912..8458a29 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -369,6 +369,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, =20 "kernel-irqchip", /* 255 */ "kernel-irqchip.split", + "intel-iommu.intremap", ); =20 =20 @@ -1720,6 +1721,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObje= ctPropsUSBNECXHCI[] =3D { { "p3", QEMU_CAPS_NEC_USB_XHCI_PORTS }, }; =20 +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = =3D { + { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, +}; + /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, @@ -1827,6 +1832,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsO= bjectProps[] =3D { { "nec-usb-xhci", virQEMUCapsObjectPropsUSBNECXHCI, ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI), -1 }, + { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU), + QEMU_CAPS_DEVICE_INTEL_IOMMU}, }; =20 struct virQEMUCapsPropTypeObjects { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 61d3ae2..2810513 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -407,6 +407,7 @@ typedef enum { /* 255 */ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=3Ds= plit */ + QEMU_CAPS_INTEL_IOMMU_INTREMAP, /* intel-iommu.intremap */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2b235c6..f162e0a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6685,6 +6685,20 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, if (!iommu) return 0; =20 + switch (iommu->model) { + case VIR_DOMAIN_IOMMU_MODEL_INTEL: + if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iommu: interrupt remapping is not supported " + "with this QEMU binary")); + return -1; + } + break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: + break; + } + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) return 0; /* Already handled via -machine */ =20 @@ -6705,6 +6719,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, return -1; } virBufferAddLit(&opts, "intel-iommu"); + if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&opts, ",intremap=3D%s", + virTristateSwitchTypeToString(iommu->intrema= p)); + } case VIR_DOMAIN_IOMMU_MODEL_LAST: break; } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.4.0.x86_64.replies index 6822181..9f256c4 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies @@ -3123,6 +3123,16 @@ { "return": [ { + "name": "version", + "type": "uint32" + } + ], + "id": "libvirt-41" +} + +{ + "return": [ + { "name": "pc-i440fx-2.4", "is-default": true, "cpu-max": 255, @@ -3246,7 +3256,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -3336,21 +3346,21 @@ "name": "qemu64" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4358,7 +4368,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -4388,7 +4398,7 @@ "capability": "events" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.5.0.x86_64.replies index 2eeed7d..876bc2f 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies @@ -3286,6 +3286,16 @@ { "return": [ { + "name": "version", + "type": "uint32" + } + ], + "id": "libvirt-41" +} + +{ + "return": [ + { "name": "pc-i440fx-2.4", "cpu-max": 255 }, @@ -3417,7 +3427,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -3507,21 +3517,21 @@ "name": "qemu64" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4566,7 +4576,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -4600,7 +4610,7 @@ "capability": "x-postcopy-ram" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -12145,7 +12155,7 @@ "meta-type": "array" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.6.0.x86_64.replies index 0c285cd..d6d0b57 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -3368,6 +3368,16 @@ { "return": [ { + "name": "version", + "type": "uint32" + } + ], + "id": "libvirt-41" +} + +{ + "return": [ + { "name": "pc-0.12", "cpu-max": 255 }, @@ -3475,7 +3485,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -3565,21 +3575,21 @@ "name": "qemu64" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4673,7 +4683,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -4707,7 +4717,7 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -12712,7 +12722,7 @@ "meta-type": "array" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.7.0.x86_64.replies index 4a87237..671a958 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3559,6 +3559,20 @@ { "return": [ { + "name": "version", + "type": "uint32" + }, + { + "name": "intremap", + "type": "bool" + } + ], + "id": "libvirt-41" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -3702,7 +3716,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -3795,21 +3809,21 @@ "name": "qemu64" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4907,7 +4921,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -4941,7 +4955,7 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -13297,7 +13311,7 @@ "meta-type": "object" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.7.0.x86_64.xml index 6c2ea59..49c0462 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -204,6 +204,7 @@ + 2007000 0 (v2.7.0) diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.8.0.x86_64.replies index b3ad912..3087d76 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies @@ -3692,6 +3692,29 @@ { "return": [ { + "name": "eim", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "x-buggy-eim", + "type": "bool" + }, + { + "name": "intremap", + "type": "bool" + }, + { + "name": "version", + "type": "uint32" + } + ], + "id": "libvirt-41" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -3855,7 +3878,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -4061,21 +4084,21 @@ "static": false } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -5198,7 +5221,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -5236,7 +5259,7 @@ "capability": "x-colo" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -14006,7 +14029,7 @@ "meta-type": "object" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.8.0.x86_64.xml index 9c8c79a..e515678 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -205,6 +205,7 @@ + 2008000 0 (v2.8.0) diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.9.0.x86_64.replies index ca206b3..37fbb6d 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies @@ -4003,6 +4003,37 @@ { "return": [ { + "name": "eim", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "caching-mode", + "type": "bool" + }, + { + "name": "x-buggy-eim", + "type": "bool" + }, + { + "name": "intremap", + "type": "bool" + }, + { + "name": "version", + "type": "uint32" + }, + { + "name": "device-iotlb", + "type": "bool" + } + ], + "id": "libvirt-41" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "pc-0.12", "cpu-max": 255 @@ -4176,7 +4207,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -4458,21 +4489,21 @@ "migration-safe": true } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { "return": [ "passthrough" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -5721,7 +5752,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -5763,7 +5794,7 @@ "capability": "release-ram" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -15049,7 +15080,7 @@ "meta-type": "object" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { @@ -15228,7 +15259,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } =20 { @@ -15469,7 +15500,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 3612603..0f273d6 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -212,6 +212,7 @@ + 2009000 0 (v2.9.0) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args b/= tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args index 43d71ad..c653987 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args @@ -16,4 +16,4 @@ QEMU_AUDIO_DRV=3Dnone \ -monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -no-acpi \ -boot c \ --device intel-iommu +-device intel-iommu,intremap=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5bc632f..a554416 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2513,6 +2513,7 @@ mymain(void) QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, + QEMU_CAPS_INTEL_IOMMU_INTREMAP, QEMU_CAPS_DEVICE_INTEL_IOMMU); =20 DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:56:44 2024 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 1493820491036751.2314107151466; Wed, 3 May 2017 07:08:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1773C68BF; Wed, 3 May 2017 14:08:05 +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 E1B4A18225; Wed, 3 May 2017 14:08:04 +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 98E8718523D5; Wed, 3 May 2017 14:08:04 +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 v43E81xM014382 for ; Wed, 3 May 2017 10:08:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 97B5E17F2C; Wed, 3 May 2017 14:08:01 +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 E31B117F5D; Wed, 3 May 2017 14:07:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1773C68BF Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.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 1773C68BF From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 3 May 2017 16:05:18 +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 5/6] conf: add caching_mode attribute to iommu device 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 03 May 2017 14:08:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add a new attribute to control the caching mode. https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- docs/formatdomain.html.in | 9 ++++ docs/schemas/domaincommon.rng | 5 +++ src/conf/domain_conf.c | 24 +++++++++-- src/conf/domain_conf.h | 1 + .../qemuxml2argv-intel-iommu-caching-mode.xml | 50 ++++++++++++++++++= ++++ .../qemuxml2xmlout-intel-iommu-caching-mode.xml | 1 + tests/qemuxml2xmltest.c | 1 + 7 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching= -mode.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-cac= hing-mode.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index ca98f0e..4552037 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7426,6 +7426,15 @@ qemu-kvm -net nic,model=3D? /dev/null Since 3.4.0 (QEMU/KVM only)

+
caching_mode
+
+

+ The caching_mode attribute with possible values + on and off can be used to + turn on the VT-d caching mode (useful for assigned devices) + Since 3.4.0 (QEMU/KVM only) +

+
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 00d9290..f88e84a 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3954,6 +3954,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4eefd92..ef31f4a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14176,6 +14176,15 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, iommu->intremap =3D val; } =20 + VIR_FREE(tmp); + if ((tmp =3D virXPathString("string(./driver/@caching_mode)", ctxt))) { + if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_XML_ERROR, _("unknown caching_mode valu= e: %s"), tmp); + goto cleanup; + } + iommu->caching_mode =3D val; + } + ret =3D iommu; iommu =3D NULL; =20 @@ -24143,9 +24152,18 @@ virDomainIOMMUDefFormat(virBufferPtr buf, =20 virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2); =20 - if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAsprintf(&childBuf, "\n", - virTristateSwitchTypeToString(iommu->intremap)); + if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT || + iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAddLit(&childBuf, "intremap) { + virBufferAsprintf(&childBuf, " intremap=3D'%s'", + virTristateSwitchTypeToString(iommu->intrema= p)); + } + if (iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, " caching_mode=3D'%s'", + virTristateSwitchTypeToString(iommu->caching= _mode)); + } + virBufferAddLit(&childBuf, "/>\n"); } =20 virBufferAsprintf(buf, " + 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-caching-mo= de.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching-mode.x= ml new file mode 120000 index 0000000..d971a35 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching-mode.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 0f00b20..81d8105 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1123,6 +1123,7 @@ mymain(void) QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_IOMMU); DO_TEST("intel-iommu-ioapic", NONE); + DO_TEST("intel-iommu-caching-mode", 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 From nobody Fri May 3 14:56:44 2024 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 14938205033831004.6320906989923; Wed, 3 May 2017 07:08:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF57780C16; Wed, 3 May 2017 14:08:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A42B180E18; Wed, 3 May 2017 14:08:19 +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 5BB985EC67; Wed, 3 May 2017 14:08:19 +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 v43E8HcV014404 for ; Wed, 3 May 2017 10:08:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 86A6417F2C; Wed, 3 May 2017 14:08:17 +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 E297E17DF5; Wed, 3 May 2017 14:08:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CF57780C16 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 CF57780C16 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 3 May 2017 16:05:19 +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 6/6] qemu: format caching-mode on iommu command line 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 03 May 2017 14:08:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Format the caching-mode option for the intel-iommu device, based on its attribute value. https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 11 ++++++++++ tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + .../qemuxml2argv-intel-iommu-caching-mode.args | 25 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 11 ++++++++++ 6 files changed, 51 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching= -mode.args diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8458a29..9d50389 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -370,6 +370,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "kernel-irqchip", /* 255 */ "kernel-irqchip.split", "intel-iommu.intremap", + "intel-iommu.caching-mode", ); =20 =20 @@ -1723,6 +1724,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjec= tPropsUSBNECXHCI[] =3D { =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = =3D { { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, + { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, }; =20 /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 2810513..aa99fda 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -408,6 +408,7 @@ typedef enum { QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=3Ds= plit */ QEMU_CAPS_INTEL_IOMMU_INTREMAP, /* intel-iommu.intremap */ + QEMU_CAPS_INTEL_IOMMU_CACHING_MODE, /* intel-iommu.caching-mode */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f162e0a..d8d0dea 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6694,6 +6694,13 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, "with this QEMU binary")); return -1; } + if (iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE))= { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iommu: caching mode is not supported " + "with this QEMU binary")); + return -1; + } break; case VIR_DOMAIN_IOMMU_MODEL_LAST: break; @@ -6723,6 +6730,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, virBufferAsprintf(&opts, ",intremap=3D%s", virTristateSwitchTypeToString(iommu->intrema= p)); } + if (iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&opts, ",caching-mode=3D%s", + virTristateSwitchTypeToString(iommu->caching= _mode)); + } case VIR_DOMAIN_IOMMU_MODEL_LAST: break; } diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 0f273d6..19fe4b7 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -213,6 +213,7 @@ + 2009000 0 (v2.9.0) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.a= rgs b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args new file mode 100644 index 0000000..1bec6d0 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args @@ -0,0 +1,25 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine q35,accel=3Dtcg \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device intel-iommu,intremap=3Don,caching-mode=3Don \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1e \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device ioh3420,port=3D0x10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2= \ +-device ich9-usb-ehci1,id=3Dusb,bus=3Dpci.2,addr=3D0x2.0x7 \ +-device rtl8139,vlan=3D0,id=3Dnet0,mac=3D52:54:00:ab:0c:5c,bus=3Dpci.2,add= r=3D0x1 \ +-net user,vlan=3D0,name=3Dhostnet0 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a554416..e308ffd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2515,6 +2515,17 @@ mymain(void) QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, QEMU_CAPS_INTEL_IOMMU_INTREMAP, QEMU_CAPS_DEVICE_INTEL_IOMMU); + DO_TEST("intel-iommu-caching-mode", + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_PCI_MULTIFUNCTION, + QEMU_CAPS_ICH9_USB_EHCI1, + QEMU_CAPS_DEVICE_INTEL_IOMMU, + QEMU_CAPS_INTEL_IOMMU_INTREMAP, + QEMU_CAPS_INTEL_IOMMU_CACHING_MODE); =20 DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); =20 --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:56:44 2024 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 1494601865595526.4924783108775; Fri, 12 May 2017 08:11:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90AE080C10; Fri, 12 May 2017 15:11:01 +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 195F58EE4A; Fri, 12 May 2017 15:11:00 +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 9A6615EC66; Fri, 12 May 2017 15:10:58 +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 v4CFAu7M027756 for ; Fri, 12 May 2017 11:10:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8CFB460F8A; Fri, 12 May 2017 15:10:56 +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 067E080F97 for ; Fri, 12 May 2017 15:10:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 90AE080C10 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 90AE080C10 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 12 May 2017 17:08:33 +0200 Message-Id: <9554d47c35e878c26641a5ec446396683fd39bfd.1494601688.git.jtomko@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv4 7/6] conf: split out virDomainIOMMUDefCheckABIStability 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 12 May 2017 15:11:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- src/conf/domain_conf.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 25dc8c6..669860c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19819,6 +19819,22 @@ virDomainMemoryDefCheckABIStability(virDomainMemor= yDefPtr src, =20 =20 static bool +virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, + virDomainIOMMUDefPtr dst) +{ + if (src->model !=3D dst->model) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain IOMMU device model '%s' " + "does not match source '%s'"), + virDomainIOMMUModelTypeToString(dst->model), + virDomainIOMMUModelTypeToString(src->model)); + return false; + } + return true; +} + + +static bool virDomainDefVcpuCheckAbiStability(virDomainDefPtr src, virDomainDefPtr dst) { @@ -20284,14 +20300,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr= src, } =20 if (src->iommu && - src->iommu->model !=3D dst->iommu->model) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target domain IOMMU device model '%s' " - "does not match source '%s'"), - virDomainIOMMUModelTypeToString(dst->iommu->model), - virDomainIOMMUModelTypeToString(src->iommu->model)); + !virDomainIOMMUDefCheckABIStability(src->iommu, dst->iommu)) goto error; - } =20 /* Coverity is not very happy with this - all dead_error_condition */ #if !STATIC_ANALYSIS --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:56:44 2024 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 149460187575632.33481395948854; Fri, 12 May 2017 08:11:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CB28C0467C2; Fri, 12 May 2017 15:11:14 +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 05A888D56D; Fri, 12 May 2017 15:11:14 +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 9748D1800C8E; Fri, 12 May 2017 15:11:13 +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 v4CFB94H027768 for ; Fri, 12 May 2017 11:11:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id B49CD7FCDC; Fri, 12 May 2017 15:11:09 +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 3B28760F8A for ; Fri, 12 May 2017 15:11:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2CB28C0467C2 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.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 2CB28C0467C2 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 12 May 2017 17:08:50 +0200 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv4 8/6] conf: add ABI stability checks for IOMMU options 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 12 May 2017 15:11:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- src/conf/domain_conf.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 669860c..9eba70a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19691,6 +19691,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } } =20 + /* ioapic */ + if (src->ioapic !=3D dst->ioapic) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of ioapic differs: " + "source: '%s', destination: '%s'"), + virDomainIOAPICTypeToString(src->ioapic), + virDomainIOAPICTypeToString(dst->ioapic)); + return false; + } + return true; } =20 @@ -19830,6 +19840,22 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUD= efPtr src, virDomainIOMMUModelTypeToString(src->model)); return false; } + if (src->intremap !=3D dst->intremap) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain IOMMU device intremap value '%s' " + "does not match source '%s'"), + virTristateSwitchTypeToString(dst->intremap), + virTristateSwitchTypeToString(src->intremap)); + return false; + } + if (src->caching_mode !=3D dst->caching_mode) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain IOMMU device caching mode '%s' " + "does not match source '%s'"), + virTristateSwitchTypeToString(dst->caching_mode), + virTristateSwitchTypeToString(src->caching_mode)); + return false; + } return true; } =20 --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 14:56:44 2024 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 1494600072611666.22009004916; Fri, 12 May 2017 07:41:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE20664D86; Fri, 12 May 2017 14:41:09 +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 99EA37DB45; Fri, 12 May 2017 14:41:09 +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 95FDF5EC68; Fri, 12 May 2017 14:41:08 +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 v4CEf6vG023296 for ; Fri, 12 May 2017 10:41:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 89D1F5C541; Fri, 12 May 2017 14:41:06 +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 01ED35C89F for ; Fri, 12 May 2017 14:41:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DE20664D86 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 DE20664D86 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 12 May 2017 16:38:43 +0200 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1.5/6] qemu: advertise ioapic tuning in the capabilities 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 12 May 2017 14:41:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add an element to . https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005 --- docs/formatcaps.html.in | 3 +++ src/conf/capabilities.c | 3 ++- src/qemu/qemu_capabilities.c | 3 ++- tests/qemucaps2xmldata/all_1.6.0-1.xml | 1 + tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/formatcaps.html.in b/docs/formatcaps.html.in index bc4511c..5b8ee5f 100644 --- a/docs/formatcaps.html.in +++ b/docs/formatcaps.html.in @@ -134,6 +134,9 @@ requires attempting the API and checking for an error to find out for sure. Since 1.2.3 +
apic
If this element is present, + the I/O APIC chip can be tuned. + Since 3.4.0
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index c36ca40..022d598 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1100,7 +1100,8 @@ virCapabilitiesFormatXML(virCapsPtr caps) STREQ(caps->guests[i]->features[j]->name, "nonpae") || STREQ(caps->guests[i]->features[j]->name, "ia64_be") || STREQ(caps->guests[i]->features[j]->name, "cpuselectio= n") || - STREQ(caps->guests[i]->features[j]->name, "deviceboot"= )) { + STREQ(caps->guests[i]->features[j]->name, "deviceboot"= ) || + STREQ(caps->guests[i]->features[j]->name, "ioapic")) { virBufferAsprintf(&buf, "<%s/>\n", caps->guests[i]->features[j]->name); } else { diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 71951e6..bbfa56c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1065,7 +1065,8 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, } =20 if (ARCH_IS_X86(guestarch) && - virCapabilitiesAddGuestFeature(guest, "apic", true, false) =3D=3D = NULL) { + (virCapabilitiesAddGuestFeature(guest, "apic", true, false) =3D=3D= NULL || + virCapabilitiesAddGuestFeature(guest, "ioapic", true, false) =3D= =3D NULL)) { goto cleanup; } =20 diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmldat= a/all_1.6.0-1.xml index 84d6000..dd93a98 100644 --- a/tests/qemucaps2xmldata/all_1.6.0-1.xml +++ b/tests/qemucaps2xmldata/all_1.6.0-1.xml @@ -23,6 +23,7 @@ +
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemu= caps2xmldata/nodisksnapshot_1.6.0-1.xml index 28762c2..5add116 100644 --- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml +++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml @@ -23,6 +23,7 @@ + --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list