From nobody Tue Apr 30 20:09:53 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 1492690823902316.09600520591357;
Thu, 20 Apr 2017 05:20:23 -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 D6A51F815;
Thu, 20 Apr 2017 12:20:20 +0000 (UTC)
Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21])
by smtp.corp.redhat.com (Postfix) with ESMTPS id BED587F6B7;
Thu, 20 Apr 2017 12:20: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 7A873B3180;
Thu, 20 Apr 2017 12:20:00 +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 v3KCJQkj020075 for ;
Thu, 20 Apr 2017 08:19:26 -0400
Received: by smtp.corp.redhat.com (Postfix)
id A0D5E17110; Thu, 20 Apr 2017 12:19:26 +0000 (UTC)
Received: from dnr.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199])
by smtp.corp.redhat.com (Postfix) with ESMTP id 2A9FA1711B
for ; Thu, 20 Apr 2017 12:19:24 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D6A51F815
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 D6A51F815
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Thu, 20 Apr 2017 14:19:13 +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
Subject: [libvirt] [PATCHv2 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.14
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]);
Thu, 20 Apr 2017 12:20:22 +0000 (UTC)
X-ZohoMail: RSF_0 Z_629925259 SPT_0
Content-Type: text/plain; charset="utf-8"
Add a new element with a mode attribute.
Possible values are off, split or on.
https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005
---
docs/formatdomain.html.in | 10 +++++++
docs/schemas/domaincommon.rng | 16 ++++++++++
src/conf/domain_conf.c | 34 ++++++++++++++++++=
+++-
src/conf/domain_conf.h | 12 ++++++++
.../qemuxml2argv-intel-iommu-irqchip.xml | 29 ++++++++++++++++++
.../qemuxml2xmlout-intel-iommu-irqchip.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
7 files changed, 102 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip=
.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irq=
chip.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index b1e38f0..abf089a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1643,6 +1643,7 @@
</kvm>
<pvspinlock state=3D'on'/>
<gic version=3D'2'/>
+ <irqchip mode=3D'split'/>
=20
</features>
...
@@ -1804,6 +1805,15 @@
for hypervisor to decide.
Since 2.1.0
+ irqchip
+ Tune the in-kernel irqchip. Possible values for the
+ mode
attribute are:
+ on
, split
and off
.
+ split
is useful for using interrupt remapping
+ with the IOMMU device .
+ The default is left for hypervisor to decide.
+ Since 3.3.0 (QEMU only)
+
=20
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index edc225f..df3143e 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4511,6 +4511,9 @@
+
+ [
+ ]
@@ -4686,6 +4689,19 @@
=20
+
+
+
+
+ off
+ split
+ on
+
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 705deb3..931320e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -140,7 +140,8 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST,
"pmu",
"vmport",
"gic",
- "smm")
+ "smm",
+ "irqchip")
=20
VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_=
LAST,
"default",
@@ -857,6 +858,12 @@ VIR_ENUM_IMPL(virDomainLoader,
"rom",
"pflash")
=20
+VIR_ENUM_IMPL(virDomainIRQChip,
+ VIR_DOMAIN_IRQCHIP_LAST,
+ "off",
+ "split",
+ "on")
+
/* Internal mapping: subset of block job types that can be present in
* XML (remaining types are not two-phase). */
VIR_ENUM_DECL(virDomainBlockJob)
@@ -17442,6 +17449,24 @@ virDomainDefParseXML(xmlDocPtr xml,
ctxt->node =3D node;
break;
=20
+ case VIR_DOMAIN_FEATURE_IRQCHIP:
+ node =3D ctxt->node;
+ ctxt->node =3D nodes[i];
+ tmp =3D virXPathString("string(./@mode)", ctxt);
+ if (tmp) {
+ int value =3D virDomainIRQChipTypeFromString(tmp);
+ if (value < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unknown irqchip mode: %s"),
+ tmp);
+ goto error;
+ }
+ def->irqchip =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;
@@ -24520,6 +24545,13 @@ virDomainDefFormatInternal(virDomainDefPtr def,
}
break;
=20
+ case VIR_DOMAIN_FEATURE_IRQCHIP:
+ if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) {
+ virBufferAsprintf(buf, "\n",
+ virDomainIRQChipTypeToString(def->ir=
qchip));
+ }
+ 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 7da554f..97c4418 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1671,6 +1671,7 @@ typedef enum {
VIR_DOMAIN_FEATURE_VMPORT,
VIR_DOMAIN_FEATURE_GIC,
VIR_DOMAIN_FEATURE_SMM,
+ VIR_DOMAIN_FEATURE_IRQCHIP,
=20
VIR_DOMAIN_FEATURE_LAST
} virDomainFeature;
@@ -1810,6 +1811,16 @@ struct _virDomainLoaderDef {
=20
void virDomainLoaderDefFree(virDomainLoaderDefPtr loader);
=20
+typedef enum {
+ VIR_DOMAIN_IRQCHIP_OFF =3D 0,
+ VIR_DOMAIN_IRQCHIP_SPLIT,
+ VIR_DOMAIN_IRQCHIP_ON,
+
+ VIR_DOMAIN_IRQCHIP_LAST
+} virDomainIRQChip;
+
+VIR_ENUM_DECL(virDomainIRQChip);
+
/* Operating system configuration data & machine / arch */
typedef struct _virDomainOSDef virDomainOSDef;
typedef virDomainOSDef *virDomainOSDefPtr;
@@ -2259,6 +2270,7 @@ struct _virDomainDef {
unsigned int hyperv_spinlocks;
virGICVersion gic_version;
char *hyperv_vendor_id;
+ virDomainIRQChip irqchip;
=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-irqchip.xml b/=
tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
new file mode 100644
index 0000000..cc895af
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.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-irqchip.xm=
l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irqchip.xml
new file mode 120000
index 0000000..58a0199
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irqchip.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e4b510f..c7d4788 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1121,6 +1121,7 @@ mymain(void)
DO_TEST("intel-iommu-machine",
QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACHINE_IOMMU);
+ DO_TEST("intel-iommu-irqchip", 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 Tue Apr 30 20:09:53 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 1492690919973905.1579402985944;
Thu, 20 Apr 2017 05:21:59 -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 B67378804;
Thu, 20 Apr 2017 12:21: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 8691417110;
Thu, 20 Apr 2017 12:21: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 32AE218523CE;
Thu, 20 Apr 2017 12:21:39 +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 v3KCJRYC020083 for ;
Thu, 20 Apr 2017 08:19:27 -0400
Received: by smtp.corp.redhat.com (Postfix)
id 6E5BA17110; Thu, 20 Apr 2017 12:19:27 +0000 (UTC)
Received: from dnr.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199])
by smtp.corp.redhat.com (Postfix) with ESMTP id EC8E877E56
for ; Thu, 20 Apr 2017 12:19:26 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B67378804
Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com;
dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx01.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 B67378804
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Thu, 20 Apr 2017 14:19:14 +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
Subject: [libvirt] [PATCHv2 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.16
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]);
Thu, 20 Apr 2017 12:21:58 +0000 (UTC)
X-ZohoMail: RSF_0 Z_629925259 SPT_0
Content-Type: text/plain; charset="utf-8"
Add kernel_irqchip=3Doff/split/on to the QEMU command line
and a capability that looks for it in query-command-line-options
output.
https://bugzilla.redhat.com/show_bug.cgi?id=3D1427005
---
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 11 +++++++++++
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 +
.../qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
.../qemuxml2argv-intel-iommu-irqchip.args | 19 +++++++++++++++=
++++
tests/qemuxml2argvtest.c | 4 ++++
21 files changed, 53 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip=
.args
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 181e178..f903c2c 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -381,6 +381,7 @@ virDomainIOThreadIDAdd;
virDomainIOThreadIDDefFree;
virDomainIOThreadIDDel;
virDomainIOThreadIDFind;
+virDomainIRQChipTypeToString;
virDomainKeyWrapCipherNameTypeFromString;
virDomainKeyWrapCipherNameTypeToString;
virDomainLeaseDefFree;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index cc3e1f8..72870b9 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -364,6 +364,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"query-cpu-definitions", /* 250 */
"block-write-threshold",
"query-named-block-nodes",
+ "kernel-irqchip",
);
=20
=20
@@ -3124,6 +3125,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
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index a7eec52..362347e 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -401,6 +401,7 @@ typedef enum {
QEMU_CAPS_QUERY_CPU_DEFINITIONS, /* qmp query-cpu-definitions */
QEMU_CAPS_BLOCK_WRITE_THRESHOLD, /* BLOCK_WRITE_THRESHOLD event */
QEMU_CAPS_QUERY_NAMED_BLOCK_NODES, /* qmp query-named-block-nodes */
+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */
=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 b2e76ca..1918933 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7379,6 +7379,17 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
}
}
=20
+ if (def->features[VIR_DOMAIN_FEATURE_IRQCHIP] =3D=3D VIR_TRISTATE_=
SWITCH_ON) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP=
)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("kernel-irqchip option is not supported b=
y this "
+ "QEMU binary"));
+ goto cleanup;
+ }
+ virBufferAsprintf(&buf, ",kernel_irqchip=3D%s",
+ virDomainIRQChipTypeToString(def->irqchip));
+ }
+
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..46e77b7 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
@@ -168,6 +168,7 @@
+
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..0c15b92 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
@@ -168,6 +168,7 @@
+
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..c2ee94d 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml
@@ -162,6 +162,7 @@
+
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..0583d6a 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
@@ -200,6 +200,7 @@
+
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..49baca8 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml
@@ -130,6 +130,7 @@
+
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..bee3ce0 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
@@ -202,6 +202,7 @@
+
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..4fc20df 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml
@@ -132,6 +132,7 @@
+
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..4e00816 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
@@ -203,6 +203,7 @@
+
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 6386c4e..1ca4df9 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
@@ -207,6 +207,7 @@
+
2008090
0
(v2.9.0-rc0-142-g940a8ce)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.args b=
/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.args
new file mode 100644
index 0000000..899d240
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.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=3Dtcg,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 c1b014b..80f10cc 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2492,6 +2492,10 @@ mymain(void)
DO_TEST("intel-iommu-machine",
QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACHINE_IOMMU);
+ DO_TEST("intel-iommu-irqchip",
+ QEMU_CAPS_MACHINE_OPT,
+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP,
+ 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 Tue Apr 30 20:09:53 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 1492691300619707.0868892421021;
Thu, 20 Apr 2017 05:28:20 -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 4684A9F728;
Thu, 20 Apr 2017 12:28:18 +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 193AF808EC;
Thu, 20 Apr 2017 12:28:18 +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 14F5E18523C4;
Thu, 20 Apr 2017 12:28:02 +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 v3KCJSwq020092 for ;
Thu, 20 Apr 2017 08:19:28 -0400
Received: by smtp.corp.redhat.com (Postfix)
id 3D9A71711B; Thu, 20 Apr 2017 12:19:28 +0000 (UTC)
Received: from dnr.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199])
by smtp.corp.redhat.com (Postfix) with ESMTP id BB5DC17110
for ; Thu, 20 Apr 2017 12:19:27 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4684A9F728
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 4684A9F728
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Thu, 20 Apr 2017 14:19:15 +0200
Message-Id:
<27646ad996d32bb0f07628ada9869b6e49e01c04.1492690592.git.jtomko@redhat.com>
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
Subject: [libvirt] [PATCHv2 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.39]);
Thu, 20 Apr 2017 12:28:19 +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 | 22 ++++++++++++-
docs/schemas/domaincommon.rng | 9 +++++
src/conf/domain_conf.c | 38 ++++++++++++++++++=
+---
src/conf/domain_conf.h | 1 +
.../qemuxml2argv-intel-iommu-irqchip.xml | 4 ++-
5 files changed, 68 insertions(+), 6 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index abf089a..f5a8e76 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7335,7 +7335,9 @@ qemu-kvm -net nic,model=3D? /dev/null
...
<devices>
- <iommu model=3D'intel'/>
+ <iommu model=3D'intel'>
+ <driver intremap=3D'on'/>
+ </iommu>
</devices>
...
@@ -7346,6 +7348,24 @@ 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. Since 3.3=
.0
+ (QEMU only)
+
+
+
+
=20
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index df3143e..7930d85 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3889,6 +3889,15 @@
intel
+
+
+
+
+ [
+ ]
+
+
+
=20
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 931320e..d40d129 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14057,12 +14057,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
@@ -14079,10 +14083,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;
@@ -14235,7 +14249,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:
@@ -18365,7 +18379,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);
@@ -24019,8 +24033,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 97c4418..f95649c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2211,6 +2211,7 @@ typedef enum {
=20
struct _virDomainIOMMUDef {
virDomainIOMMUModel model;
+ virTristateSwitch intremap;
};
/*
* Guest VM main configuration
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml b/=
tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
index cc895af..2100c08 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.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 Tue Apr 30 20:09:53 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 1492691322616286.7290252791993;
Thu, 20 Apr 2017 05:28:42 -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 98E913DBF9;
Thu, 20 Apr 2017 12:28:40 +0000 (UTC)
Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21])
by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A095187B6;
Thu, 20 Apr 2017 12:28:40 +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 1130B4ED26;
Thu, 20 Apr 2017 12:28:22 +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 v3KCJTPZ020101 for ;
Thu, 20 Apr 2017 08:19:29 -0400
Received: by smtp.corp.redhat.com (Postfix)
id 308C81711B; Thu, 20 Apr 2017 12:19:29 +0000 (UTC)
Received: from dnr.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199])
by smtp.corp.redhat.com (Postfix) with ESMTP id 8923B77E55
for ; Thu, 20 Apr 2017 12:19:28 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 98E913DBF9
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 98E913DBF9
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Thu, 20 Apr 2017 14:19:16 +0200
Message-Id:
<83d8f2bc303a1910bcaf82a9ed32da116734edc8.1492690592.git.jtomko@redhat.com>
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
Subject: [libvirt] [PATCHv2 4/6] qemu: format intremap= on intel-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.13
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]);
Thu, 20 Apr 2017 12:28:41 +0000 (UTC)
X-ZohoMail: RSF_0 Z_629925259 SPT_0
Content-Type: text/plain; charset="utf-8"
Add the intremap=3D option to QEMU command line, corresponding
to the attribute of the iommu device.
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-irqchip.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 72870b9..0c7d7b1 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -365,6 +365,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"block-write-threshold",
"query-named-block-nodes",
"kernel-irqchip",
+ "intel-iommu-intremap",
);
=20
=20
@@ -1715,6 +1716,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},
@@ -1822,6 +1827,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 362347e..4d19691 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -402,6 +402,7 @@ typedef enum {
QEMU_CAPS_BLOCK_WRITE_THRESHOLD, /* BLOCK_WRITE_THRESHOLD event */
QEMU_CAPS_QUERY_NAMED_BLOCK_NODES, /* qmp query-named-block-nodes */
QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */
+ 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 1918933..1f97bd0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6681,6 +6681,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
@@ -6701,6 +6715,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 bee3ce0..ab0f8d2 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
@@ -203,6 +203,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 4e00816..85cae14 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
@@ -204,6 +204,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 bae2475..3cfefb7 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
{
@@ -14888,7 +14919,7 @@
"meta-type": "object"
}
],
- "id": "libvirt-47"
+ "id": "libvirt-48"
}
=20
{
@@ -15067,7 +15098,7 @@
}
}
},
- "id": "libvirt-48"
+ "id": "libvirt-49"
}
=20
{
@@ -15308,7 +15339,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 1ca4df9..799c52a 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
@@ -208,6 +208,7 @@
+
2008090
0
(v2.9.0-rc0-142-g940a8ce)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.args b=
/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.args
index 899d240..6c1e96a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.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 80f10cc..29cd8b5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2495,6 +2495,7 @@ mymain(void)
DO_TEST("intel-iommu-irqchip",
QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACHINE_KERNEL_IRQCHIP,
+ 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 Tue Apr 30 20:09:53 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 1492690858529622.3035698460185;
Thu, 20 Apr 2017 05:20:58 -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 4CA7C3D963;
Thu, 20 Apr 2017 12:20:56 +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 0C3AD827B4;
Thu, 20 Apr 2017 12:20:56 +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 BBB7E18523C7;
Thu, 20 Apr 2017 12:20:36 +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 v3KCJUcQ020111 for ;
Thu, 20 Apr 2017 08:19:30 -0400
Received: by smtp.corp.redhat.com (Postfix)
id F29CB1711B; Thu, 20 Apr 2017 12:19:29 +0000 (UTC)
Received: from dnr.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199])
by smtp.corp.redhat.com (Postfix) with ESMTP id 7CB0F17110
for ; Thu, 20 Apr 2017 12:19:29 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4CA7C3D963
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 4CA7C3D963
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Thu, 20 Apr 2017 14:19:17 +0200
Message-Id:
<8a12f136ee79ca81d12770967f2f1aefd79c358e.1492690592.git.jtomko@redhat.com>
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
Subject: [libvirt] [PATCHv2 5/6] conf: add caching 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.12
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]);
Thu, 20 Apr 2017 12:20:57 +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.xml | 28 ++++++++++++++++++=
++++
.../qemuxml2xmlout-intel-iommu-caching.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
7 files changed, 66 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching=
.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-cac=
hing.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index f5a8e76..dbca316 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7364,6 +7364,15 @@ qemu-kvm -net nic,model=3D? /dev/null
(QEMU only)
+ caching
+
+
+ The caching
attribute with possible values
+ on
and off
can be used to
+ turn on the caching mode. Since 3.3.0<=
/span>
+ (QEMU only)
+
+
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 7930d85..b237140 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3896,6 +3896,11 @@
[
+ ]
+
+ [
+ ]
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d40d129..cdeb60b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14092,6 +14092,15 @@ virDomainIOMMUDefParseXML(xmlNodePtr node,
iommu->intremap =3D val;
}
=20
+ VIR_FREE(tmp);
+ if ((tmp =3D virXPathString("string(./driver/@caching)", ctxt))) {
+ if ((val =3D virTristateSwitchTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_XML_ERROR, _("unknown caching value: %s=
"), tmp);
+ goto cleanup;
+ }
+ iommu->caching =3D val;
+ }
+
ret =3D iommu;
iommu =3D NULL;
=20
@@ -24037,9 +24046,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 !=3D VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAddLit(&childBuf, "intremap) {
+ virBufferAsprintf(&childBuf, " intremap=3D'%s'",
+ virTristateSwitchTypeToString(iommu->intrema=
p));
+ }
+ if (iommu->caching !=3D VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&childBuf, " caching=3D'%s'",
+ virTristateSwitchTypeToString(iommu->caching=
));
+ }
+ 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.xm=
l b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching.xml
new file mode 120000
index 0000000..6935d93
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-intel-iommu-caching.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index c7d4788..a4d5e97 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1122,6 +1122,7 @@ mymain(void)
QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACHINE_IOMMU);
DO_TEST("intel-iommu-irqchip", NONE);
+ DO_TEST("intel-iommu-caching", 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 Tue Apr 30 20:09:53 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 1492690942029984.2729420642087;
Thu, 20 Apr 2017 05:22:22 -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 11D0D8AE6C;
Thu, 20 Apr 2017 12:22:20 +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 B6764189F3;
Thu, 20 Apr 2017 12:22: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 3F33318523CC;
Thu, 20 Apr 2017 12:22:02 +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 v3KCJUKO020118 for ;
Thu, 20 Apr 2017 08:19:30 -0400
Received: by smtp.corp.redhat.com (Postfix)
id C167C77E58; Thu, 20 Apr 2017 12:19:30 +0000 (UTC)
Received: from dnr.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199])
by smtp.corp.redhat.com (Postfix) with ESMTP id 4B45A17110
for ; Thu, 20 Apr 2017 12:19:30 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 11D0D8AE6C
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 11D0D8AE6C
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Thu, 20 Apr 2017 14:19:18 +0200
Message-Id:
<5224b102b62312b5444a32440ce9aea15dbd0ce2.1492690592.git.jtomko@redhat.com>
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
Subject: [libvirt] [PATCHv2 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.11
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]);
Thu, 20 Apr 2017 12:22:20 +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.args | 19 +++++++++++++++=
++++
tests/qemuxml2argvtest.c | 5 +++++
6 files changed, 39 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching=
.args
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0c7d7b1..88ea306 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -366,6 +366,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"query-named-block-nodes",
"kernel-irqchip",
"intel-iommu-intremap",
+ "intel-iommu-caching",
);
=20
=20
@@ -1718,6 +1719,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 },
};
=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 4d19691..2409377 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -403,6 +403,7 @@ typedef enum {
QEMU_CAPS_QUERY_NAMED_BLOCK_NODES, /* qmp query-named-block-nodes */
QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */
QEMU_CAPS_INTEL_IOMMU_INTREMAP, /* intel-iommu.intremap */
+ QEMU_CAPS_INTEL_IOMMU_CACHING, /* 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 1f97bd0..55800c7 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6690,6 +6690,13 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd,
"with this QEMU binary"));
return -1;
}
+ if (iommu->caching !=3D VIR_TRISTATE_SWITCH_ABSENT &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING)) {
+ 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;
@@ -6719,6 +6726,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd,
virBufferAsprintf(&opts, ",intremap=3D%s",
virTristateSwitchTypeToString(iommu->intrema=
p));
}
+ if (iommu->caching !=3D VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&opts, ",caching-mode=3D%s",
+ virTristateSwitchTypeToString(iommu->caching=
));
+ }
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 799c52a..0193492 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
@@ -209,6 +209,7 @@
+
2008090
0
(v2.9.0-rc0-142-g940a8ce)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching.args b=
/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching.args
new file mode 100644
index 0000000..dee63f4
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching.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=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
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 29cd8b5..9950f7f 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2497,6 +2497,11 @@ mymain(void)
QEMU_CAPS_MACHINE_KERNEL_IRQCHIP,
QEMU_CAPS_INTEL_IOMMU_INTREMAP,
QEMU_CAPS_DEVICE_INTEL_IOMMU);
+ DO_TEST("intel-iommu-caching",
+ QEMU_CAPS_MACHINE_OPT,
+ QEMU_CAPS_DEVICE_INTEL_IOMMU,
+ QEMU_CAPS_INTEL_IOMMU_INTREMAP,
+ QEMU_CAPS_INTEL_IOMMU_CACHING);
=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