From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057384; cv=none; d=zoho.com; s=zohoarc; b=H++zzCOKUZg+65FLkTgCJtf5789NcPOLuhmVerjEKS4JllRsiJdpeIIhMkPKz07MFAKdZwMzG+WZOVwVpxhjuPp6GBS7p/7qjaHIvFa50wWtkQ70hLpmLaiVzgwrZbBGBKxvnKqxPTywvSxCJId6bzz2AVJuLanEL292KYC+ikM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057384; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=UgOvFv5Q/ehDY8IFebfzfnkyFBQg8Q7bbr3ZOU5Nclk=; b=Is+miVf590Tnh6/sXqnn5WhLJri1XMxlDBxQWkMfmViOczPOXJRBRpvVsRQeaClbAjo1U/imv+3E0JSdWo43rl93jDJ18PoVaVDqoKr57/7zVUpMOul77iEG3qibOJedP9xS8ECG0qfghweLubDkqL/lYMQLspMA/U4yjUxEEec= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155905738474545.061302060533876; Tue, 28 May 2019 08:29:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD80B3087958; Tue, 28 May 2019 15:29:36 +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 88B14100203C; Tue, 28 May 2019 15:29:26 +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 8CE9C1833001; Tue, 28 May 2019 15:29:16 +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 x4SFTCJA015562 for ; Tue, 28 May 2019 11:29:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7ACFD5C1B5; Tue, 28 May 2019 15:29:12 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F27FDBF9F8 for ; Tue, 28 May 2019 15:29:11 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:28:54 +0200 Message-Id: <20190528152904.25650-2-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/11] qemu: Fix switch() statements for virDomainIOMMUModel 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 28 May 2019 15:29:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Ensure unexpected values are dealt with correctly, that is by invoking virReportEnumRangeError() and immediately returning a negative value to the caller. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 10 ++++++++-- src/qemu/qemu_domain.c | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5bf6c704e0..fcc6caf42f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6961,8 +6961,12 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, virBufferAsprintf(&opts, ",device-iotlb=3D%s", virTristateSwitchTypeToString(iommu->iotlb)); } - case VIR_DOMAIN_IOMMU_MODEL_LAST: break; + + case VIR_DOMAIN_IOMMU_MODEL_LAST: + default: + virReportEnumRangeError(virDomainIOMMUModel, iommu->model); + return -1; } virCommandAddArg(cmd, "-device"); virCommandAddArgBuffer(cmd, &opts); @@ -7609,7 +7613,9 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAddLit(&buf, ",iommu=3Don"); break; case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; + default: + virReportEnumRangeError(virDomainIOMMUModel, def->iommu->model= ); + return -1; } } =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e50e84a3b2..366ebe1604 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6138,6 +6138,7 @@ qemuDomainDeviceDefValidateIOMMU(const virDomainIOMMU= Def *iommu, case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); + return -1; } =20 return 0; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057384; cv=none; d=zoho.com; s=zohoarc; b=ljoigKzNg3L/QgCpAkgvp0+cXOKL0awJkfNdXns0US7AHBJCCZk2q4pTwsWYSS/X4zLwPk5wwG3F5zEVZCy58tRGmjhAJU9WolUaDYE5zA4lbpl3QkHTzG3Kso3YKEuXtb5R2aZgHrsbP/ER3SmDhlN5meTOShUxCQTNE0fv3v8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057384; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=D4oqnMxI6I4Mf7FwGl2bWXpMXwwfsVTDesuuRemsd7I=; b=V1SUoeAKNGvYtN4D0Kir+SKpeep9MsHt0hUxM6MxsVAMgh5jrlF3lGLRn2f37UO965zEVY+5QGmHtxxR8gpKgD8sECkiogvHN6cK0w8E0FKKAPFYQdQ7vVjQEYwZPaV9ezkdeEdX4+V2yd26vb9Ei5ghS+xWcXkKdlz3RV28CKM= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057384660381.52172885879804; Tue, 28 May 2019 08:29:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAF6890C77; Tue, 28 May 2019 15:29:39 +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 212C02B585; Tue, 28 May 2019 15:29:33 +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 3FCCA1833003; Tue, 28 May 2019 15:29:15 +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 x4SFTDSh015572 for ; Tue, 28 May 2019 11:29:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 43F58BF9EF; Tue, 28 May 2019 15:29:13 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C18375C1B5 for ; Tue, 28 May 2019 15:29:12 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:28:55 +0200 Message-Id: <20190528152904.25650-3-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/11] qemu: Drop 'ret' from qemuBuildIOMMUCommandLine() 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 28 May 2019 15:29:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fcc6caf42f..4a3aa26d7e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6930,7 +6930,6 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, { virBuffer opts =3D VIR_BUFFER_INITIALIZER; const virDomainIOMMUDef *iommu =3D def->iommu; - int ret =3D -1; =20 if (!iommu) return 0; @@ -6971,9 +6970,8 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, "-device"); virCommandAddArgBuffer(cmd, &opts); =20 - ret =3D 0; virBufferFreeAndReset(&opts); - return ret; + return 0; } =20 =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057410; cv=none; d=zoho.com; s=zohoarc; b=LH8od2mxD13zU60LpWnMpu70Nzd3lxASc5fNw8yxIggL6LbkAl34dalxEAd7eyva7B59XvgG29mgO9g1ium1/wacX3jaUbKkzy1mvxI3flxVmDRvDAInrNBUonVRSByVF7Y7RnoLb2EETt3qjm6XWZdmdC2fhj7+E8CG7Dksr3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057410; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rFt75+1yF10Cm3nHENTod/NQFUTztqEav6mdfq+jIjI=; b=Y+tfBS3IzUSL4Ti5ZSnnXTBfZN1SEEOvEaL+Mkmlcv/V53EaoYYq48RAksfSYWrMsvZkOhttU3dK3AqwzAtkNO09UkA83zTtfh/Mu7WsY9XnNl4McOISsbP+8wDvYHM8BzSyPmK+h7HP86xEWl/kq6HD1zBjcGslk54PInXHwsk= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057410941618.7292284616501; Tue, 28 May 2019 08:30:10 -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 C7D6D81E14; Tue, 28 May 2019 15:30:08 +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 82DEB2F294; Tue, 28 May 2019 15:30:08 +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 09F65206D2; Tue, 28 May 2019 15:30: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 x4SFTElc015578 for ; Tue, 28 May 2019 11:29:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1549EBF9F3; Tue, 28 May 2019 15:29:14 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9115C5C1B5 for ; Tue, 28 May 2019 15:29:13 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:28:56 +0200 Message-Id: <20190528152904.25650-4-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/11] qemu: Use VIR_AUTOCLEAN() in qemuBuildIOMMUCommandLine() 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: , 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.25]); Tue, 28 May 2019 15:30:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4a3aa26d7e..dd7ea0941d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6928,7 +6928,7 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { - virBuffer opts =3D VIR_BUFFER_INITIALIZER; + VIR_AUTOCLEAN(virBuffer) opts =3D VIR_BUFFER_INITIALIZER; const virDomainIOMMUDef *iommu =3D def->iommu; =20 if (!iommu) @@ -6970,7 +6970,6 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, "-device"); virCommandAddArgBuffer(cmd, &opts); =20 - virBufferFreeAndReset(&opts); return 0; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057423; cv=none; d=zoho.com; s=zohoarc; b=k49Nd201KzRW25Nm9UUEdRgl4IvGbnPrEzAXxfyJhmz/PFe39FdqG1YPRa0/zum0n02yh7HXedJDjhh2G0mGdmd84owg67xezsqNrLDSWwobqMmRU8LeomK9Mr9a7ibvtXxCHGqHflXRv3Qno6SJrbZb2MoNsRt0qDaDU5MI5yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057423; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=7PKb4EKQsr7PnSQvgQ5JesKdmQA3wviOMQpdNWXnRis=; b=oTOBaaiz/3BDho5st99koMGO5J2FH7mlShmwi0m+Yr2v5oNLgLxwhYKo4dnmLFR4neTo9hPVtW0zOAfYWBh+dXCqe8y95kUmNOaxMwwPbxsdMrrD+J9xyz+dNAnsyUVIoqI+eB/lUReff0VL5XhvhqClQqlbddBVSvi2zJF2krI= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057423392636.0636052978487; Tue, 28 May 2019 08:30:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FD1AC0A4F54; Tue, 28 May 2019 15:30:21 +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 46099348E9; Tue, 28 May 2019 15:30:21 +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 E8066183300C; Tue, 28 May 2019 15:30:20 +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 x4SFTE3b015588 for ; Tue, 28 May 2019 11:29:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id D87965C26D; Tue, 28 May 2019 15:29:14 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 621BA5C1B5 for ; Tue, 28 May 2019 15:29:14 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:28:57 +0200 Message-Id: <20190528152904.25650-5-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/11] qemu: Move virBuffer inside switch() statement 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 28 May 2019 15:30:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This doesn't make a whole lot of difference now, but once we introduce more virDomainIOMMUModel values the current structure will no longer work. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index dd7ea0941d..d5016cc99c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6928,7 +6928,6 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { - VIR_AUTOCLEAN(virBuffer) opts =3D VIR_BUFFER_INITIALIZER; const virDomainIOMMUDef *iommu =3D def->iommu; =20 if (!iommu) @@ -6942,7 +6941,9 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, return 0; =20 switch (iommu->model) { - case VIR_DOMAIN_IOMMU_MODEL_INTEL: + case VIR_DOMAIN_IOMMU_MODEL_INTEL: { + VIR_AUTOCLEAN(virBuffer) opts =3D VIR_BUFFER_INITIALIZER; + virBufferAddLit(&opts, "intel-iommu"); if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { virBufferAsprintf(&opts, ",intremap=3D%s", @@ -6960,15 +6961,17 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, virBufferAsprintf(&opts, ",device-iotlb=3D%s", virTristateSwitchTypeToString(iommu->iotlb)); } + + virCommandAddArg(cmd, "-device"); + virCommandAddArgBuffer(cmd, &opts); break; + } =20 case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); return -1; } - virCommandAddArg(cmd, "-device"); - virCommandAddArgBuffer(cmd, &opts); =20 return 0; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057411; cv=none; d=zoho.com; s=zohoarc; b=HwvFPCSCq+CZHQ452L27wNe+HEUutwEZoc2bg2vmjf6Li+6oC7/1hbjHtcRAWcJSSS8z8qmxiq7gbNGCtL+dbiT5P/9jIX+Uh2Y13kiEQkzo7lRFKoudVg5JDnV2cBlsncpax30fi6aVJVAYP8AaBLgdZY9Wb7miRXM5G+lgF38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057411; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=qbEkQrqIxPNw9ruDWgaKis9GZBwxVF0W9D69Jw8QPGU=; b=jjpiUVXox+mCfaKWRZYP21oxrEaur2092ZmoR+UKxVu659DYfjk4YZexaVBGTvicexWTcJ5KdFAoI/N3xZwuRevAkEblVevJCWdArmu1nm3jaE3ypBtzxy0n9voO6Bo/y4Oc4Tk7Jtmc9KQVfIVJWJzbGVpBsXs0iHfh4JDnl6Q= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057411413927.5964339705257; Tue, 28 May 2019 08:30:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62BA4307E040; Tue, 28 May 2019 15:30: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 28A7511436E3; Tue, 28 May 2019 15:30: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 BB30F206D4; Tue, 28 May 2019 15:30: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 x4SFTFnE015598 for ; Tue, 28 May 2019 11:29:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id A823FBF9F3; Tue, 28 May 2019 15:29:15 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 318145C26D for ; Tue, 28 May 2019 15:29:15 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:28:58 +0200 Message-Id: <20190528152904.25650-6-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/11] qemu: Move capability checks inside switch() statements 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 28 May 2019 15:30:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Current capability checks are specific to Intel IOMMU, so we need to move them inside the switch() statement before we can introduce more virDomainIOMMUModel values. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d5016cc99c..b2b9bef772 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6933,17 +6933,17 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, if (!iommu) return 0; =20 - /* qemuDomainDeviceDefValidate() already made sure we have one of - * QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU: here we - * handle the former case, while the latter is taken care of in - * qemuBuildMachineCommandLine() */ - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU)) - return 0; - switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_INTEL: { VIR_AUTOCLEAN(virBuffer) opts =3D VIR_BUFFER_INITIALIZER; =20 + /* qemuDomainDeviceDefValidateIOMMU() already made sure we have + * one of QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU: + * here we handle the former case, while the latter is taken care + * of in qemuBuildMachineCommandLine() */ + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU)) + return 0; + virBufferAddLit(&opts, "intel-iommu"); if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { virBufferAsprintf(&opts, ",intremap=3D%s", @@ -7602,15 +7602,15 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, } } =20 - /* qemuDomainDeviceDefValidate() already made sure we have one of - * QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU: here we - * handle the latter case, while the former is taken care of in - * qemuBuildIOMMUCommandLine() */ - if (def->iommu && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) { + if (def->iommu) { switch (def->iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_INTEL: - virBufferAddLit(&buf, ",iommu=3Don"); + /* qemuDomainDeviceDefValidateIOMMU() already made sure we have + * one of QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IO= MMU: + * here we handle the latter case, while the former is taken c= are + * of in qemuBuildIOMMUCommandLine() */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) + virBufferAddLit(&buf, ",iommu=3Don"); break; case VIR_DOMAIN_IOMMU_MODEL_LAST: default: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057426; cv=none; d=zoho.com; s=zohoarc; b=mLDAVCgbwN2JVW5+nbY28tNhEV6SlYv3Xp/1OOZj/LUwrB424WQuflYwJdIJ70wcFIpXM02IpXs/VypZ5K7dLghrtJ4/vbyPlhmUu3ayWvJayedi6BLI48SZ9QjWhS4p0bt+IzMXlU65mu8IdKaWEM4DmQQtZ/Zw9LsaWuZlTvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057426; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rqbVo+akaMSUaq7tHAud0mTsFEZjEVcXgk6SQYprG04=; b=Ul2+eDvRzq2PEeHS9DxsdFoBCJW1pwjvcr4QMdH/Yvcj9QdkWCDyVsIr5C8yKX+wmYxHpmLccNxDK+cYwngLRpbTHoCrJuukvWkOjce4bihda+4+SRwy8+eYST0yuyKonSeLzQxtk7iYPVS6YtS6G+Y9/PUiMbAWZ8ZetUQC5pw= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057426295570.6218752002961; Tue, 28 May 2019 08:30:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BEDE83079B92; Tue, 28 May 2019 15:30:23 +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 89FA410027D2; Tue, 28 May 2019 15:30:23 +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 3B185206D8; Tue, 28 May 2019 15:30:23 +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 x4SFTGiT015606 for ; Tue, 28 May 2019 11:29:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id D6A895C241; Tue, 28 May 2019 15:29:16 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12E185C70C for ; Tue, 28 May 2019 15:29:15 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:28:59 +0200 Message-Id: <20190528152904.25650-7-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/11] qemu: Introduce QEMU_CAPS_MACHINE_VIRT_IOMMU X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 28 May 2019 15:30:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This capability can be used to figure out whether the QEMU binary at hand supports the machine type property we need in order to enable SMMUv3 IOMMU support. Unfortunately we can't avoid probing the RISC-V binaries along with the ARM ones, since both architectures have their own 'virt' machine type. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + .../caps_2.12.0.aarch64.replies | 166 +++++++++++++++-- .../caps_3.0.0.riscv32.replies | 131 +++++++++++++- .../caps_3.0.0.riscv64.replies | 131 +++++++++++++- .../caps_4.0.0.aarch64.replies | 171 ++++++++++++++++-- .../caps_4.0.0.aarch64.xml | 1 + .../caps_4.0.0.riscv32.replies | 129 ++++++++++++- .../caps_4.0.0.riscv64.replies | 129 ++++++++++++- 9 files changed, 805 insertions(+), 62 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a827bd24e3..bf069fa8ea 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -525,6 +525,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio-pci-non-transitional", "overcommit", "query-current-machine", + "machine.virt.iommu", ); =20 =20 @@ -1406,10 +1407,17 @@ static struct virQEMUCapsStringFlags virQEMUCapsMac= hinePropsPSeries[] =3D { { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV }, }; =20 +static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] =3D { + { "iommu", QEMU_CAPS_MACHINE_VIRT_IOMMU }, +}; + static virQEMUCapsObjectTypeProps virQEMUCapsMachineProps[] =3D { { "pseries", virQEMUCapsMachinePropsPSeries, ARRAY_CARDINALITY(virQEMUCapsMachinePropsPSeries), -1 }, + { "virt", virQEMUCapsMachinePropsVirt, + ARRAY_CARDINALITY(virQEMUCapsMachinePropsVirt), + -1 }, }; =20 static void diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 67c8e80462..0f282ad239 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -507,6 +507,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL, /* virtio *-pci-{non-}transitional = devices */ QEMU_CAPS_OVERCOMMIT, /* -overcommit */ QEMU_CAPS_QUERY_CURRENT_MACHINE, /* query-current-machine command */ + QEMU_CAPS_MACHINE_VIRT_IOMMU, /* -machine virt,iommu */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies b/tests= /qemucapabilitiesdata/caps_2.12.0.aarch64.replies index 67553451fc..7a3d0fe0e4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies @@ -5633,10 +5633,148 @@ } =20 { - "execute": "query-cpu-definitions", + "execute": "qom-list-properties", + "arguments": { + "typename": "virt-2.12-machine" + }, "id": "libvirt-32" } =20 +{ + "return": [ + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "memory-encryption", + "description": "Set memory encyption object to use", + "type": "string" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "virtualization", + "description": "Set on/off to enable/disable emulating a guest CPU w= hich implements the ARM Virtualization Extensions", + "type": "bool" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "its", + "description": "Set on/off to enable/disable ITS instantiation", + "type": "bool" + }, + { + "name": "gic-version", + "description": "Set GIC version. Valid values are 2, 3 and host", + "type": "string" + }, + { + "name": "highmem", + "description": "Set on/off to enable/disable using physical address = space above 32 bits", + "type": "bool" + }, + { + "name": "secure", + "description": "Set on/off to enable/disable the ARM Security Extens= ions (TrustZone)", + "type": "bool" + } + ], + "id": "libvirt-32" +} + +{ + "execute": "query-cpu-definitions", + "id": "libvirt-33" +} + { "return": [ { @@ -5810,35 +5948,35 @@ "static": false } ], - "id": "libvirt-32" + "id": "libvirt-33" } =20 { "execute": "query-tpm-models", - "id": "libvirt-33" + "id": "libvirt-34" } =20 { "return": [ ], - "id": "libvirt-33" + "id": "libvirt-34" } =20 { "execute": "query-tpm-types", - "id": "libvirt-34" + "id": "libvirt-35" } =20 { "return": [ "emulator" ], - "id": "libvirt-34" + "id": "libvirt-35" } =20 { "execute": "query-command-line-options", - "id": "libvirt-35" + "id": "libvirt-36" } =20 { @@ -6999,12 +7137,12 @@ "option": "drive" } ], - "id": "libvirt-35" + "id": "libvirt-36" } =20 { "execute": "query-migrate-capabilities", - "id": "libvirt-36" + "id": "libvirt-37" } =20 { @@ -7066,12 +7204,12 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-36" + "id": "libvirt-37" } =20 { "execute": "query-qmp-schema", - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -18439,12 +18577,12 @@ "meta-type": "object" } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { "execute": "query-gic-capabilities", - "id": "libvirt-38" + "id": "libvirt-39" } =20 { @@ -18460,7 +18598,7 @@ "kernel": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies b/tests/= qemucapabilitiesdata/caps_3.0.0.riscv32.replies index 389fc95e0e..8159b26d19 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies @@ -1698,32 +1698,145 @@ } =20 { - "execute": "query-tpm-models", + "execute": "qom-list-properties", + "arguments": { + "typename": "virt-machine" + }, "id": "libvirt-28" } =20 { "return": [ + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "memory-encryption", + "description": "Set memory encyption object to use", + "type": "string" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "type", + "type": "string" + } ], "id": "libvirt-28" } =20 { - "execute": "query-tpm-types", + "execute": "query-tpm-models", "id": "libvirt-29" } =20 +{ + "return": [ + ], + "id": "libvirt-29" +} + +{ + "execute": "query-tpm-types", + "id": "libvirt-30" +} + { "return": [ "passthrough", "emulator" ], - "id": "libvirt-29" + "id": "libvirt-30" } =20 { "execute": "query-command-line-options", - "id": "libvirt-30" + "id": "libvirt-31" } =20 { @@ -2848,12 +2961,12 @@ "option": "drive" } ], - "id": "libvirt-30" + "id": "libvirt-31" } =20 { "execute": "query-migrate-capabilities", - "id": "libvirt-31" + "id": "libvirt-32" } =20 { @@ -2923,12 +3036,12 @@ "capability": "late-block-activate" } ], - "id": "libvirt-31" + "id": "libvirt-32" } =20 { "execute": "query-qmp-schema", - "id": "libvirt-32" + "id": "libvirt-33" } =20 { @@ -14603,5 +14716,5 @@ "meta-type": "object" } ], - "id": "libvirt-32" + "id": "libvirt-33" } diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies b/tests/= qemucapabilitiesdata/caps_3.0.0.riscv64.replies index 65da947c60..995ca86784 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies @@ -1698,32 +1698,145 @@ } =20 { - "execute": "query-tpm-models", + "execute": "qom-list-properties", + "arguments": { + "typename": "virt-machine" + }, "id": "libvirt-28" } =20 { "return": [ + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "memory-encryption", + "description": "Set memory encyption object to use", + "type": "string" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "type", + "type": "string" + } ], "id": "libvirt-28" } =20 { - "execute": "query-tpm-types", + "execute": "query-tpm-models", "id": "libvirt-29" } =20 +{ + "return": [ + ], + "id": "libvirt-29" +} + +{ + "execute": "query-tpm-types", + "id": "libvirt-30" +} + { "return": [ "passthrough", "emulator" ], - "id": "libvirt-29" + "id": "libvirt-30" } =20 { "execute": "query-command-line-options", - "id": "libvirt-30" + "id": "libvirt-31" } =20 { @@ -2848,12 +2961,12 @@ "option": "drive" } ], - "id": "libvirt-30" + "id": "libvirt-31" } =20 { "execute": "query-migrate-capabilities", - "id": "libvirt-31" + "id": "libvirt-32" } =20 { @@ -2923,12 +3036,12 @@ "capability": "late-block-activate" } ], - "id": "libvirt-31" + "id": "libvirt-32" } =20 { "execute": "query-qmp-schema", - "id": "libvirt-32" + "id": "libvirt-33" } =20 { @@ -14603,5 +14716,5 @@ "meta-type": "object" } ], - "id": "libvirt-32" + "id": "libvirt-33" } diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies b/tests/= qemucapabilitiesdata/caps_4.0.0.aarch64.replies index 128ee04e86..91943860b1 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies @@ -6211,10 +6211,153 @@ } =20 { - "execute": "query-cpu-definitions", + "execute": "qom-list-properties", + "arguments": { + "typename": "virt-4.0-machine" + }, + "id": "libvirt-33" +} + +{ + "return": [ + { + "name": "type", + "type": "string" + }, + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "memory-encryption", + "description": "Set memory encryption object to use", + "type": "string" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "virtualization", + "description": "Set on/off to enable/disable emulating a guest CPU w= hich implements the ARM Virtualization Extensions", + "type": "bool" + }, + { + "name": "its", + "description": "Set on/off to enable/disable ITS instantiation", + "type": "bool" + }, + { + "name": "gic-version", + "description": "Set GIC version. Valid values are 2, 3 and host", + "type": "string" + }, + { + "name": "highmem", + "description": "Set on/off to enable/disable using physical address = space above 32 bits", + "type": "bool" + }, + { + "name": "secure", + "description": "Set on/off to enable/disable the ARM Security Extens= ions (TrustZone)", + "type": "bool" + }, + { + "name": "iommu", + "description": "Set the IOMMU type. Valid values are none and smmuv3= ", + "type": "string" + } + ], "id": "libvirt-33" } =20 +{ + "execute": "query-cpu-definitions", + "id": "libvirt-34" +} + { "return": [ { @@ -6403,34 +6546,34 @@ "static": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } =20 { "execute": "query-tpm-models", - "id": "libvirt-34" + "id": "libvirt-35" } =20 { "return": [ ], - "id": "libvirt-34" + "id": "libvirt-35" } =20 { "execute": "query-tpm-types", - "id": "libvirt-35" + "id": "libvirt-36" } =20 { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } =20 { "execute": "query-command-line-options", - "id": "libvirt-36" + "id": "libvirt-37" } =20 { @@ -7578,12 +7721,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } =20 { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -7657,12 +7800,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { "execute": "query-qmp-schema", - "id": "libvirt-38" + "id": "libvirt-39" } =20 { @@ -19749,12 +19892,12 @@ ] } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "execute": "query-gic-capabilities", - "id": "libvirt-39" + "id": "libvirt-40" } =20 { @@ -19770,7 +19913,7 @@ "kernel": false } ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_4.0.0.aarch64.xml index 7bcda0b402..e071bc0c8d 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml @@ -160,6 +160,7 @@ + 4000000 0 61700758 diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies b/tests/= qemucapabilitiesdata/caps_4.0.0.riscv32.replies index 053b714825..c2ca623a0b 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies @@ -4080,18 +4080,120 @@ } =20 { - "execute": "query-tpm-models", + "execute": "qom-list-properties", + "arguments": { + "typename": "virt-machine" + }, "id": "libvirt-34" } =20 { "return": [ + { + "name": "type", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "memory-encryption", + "description": "Set memory encryption object to use", + "type": "string" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + } ], "id": "libvirt-34" } =20 { - "execute": "query-tpm-types", + "execute": "query-tpm-models", "id": "libvirt-35" } =20 @@ -4102,10 +4204,21 @@ } =20 { - "execute": "query-command-line-options", + "execute": "query-tpm-types", "id": "libvirt-36" } =20 +{ + "return": [ + ], + "id": "libvirt-36" +} + +{ + "execute": "query-command-line-options", + "id": "libvirt-37" +} + { "return": [ { @@ -5375,12 +5488,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } =20 { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -5454,12 +5567,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { "execute": "query-qmp-schema", - "id": "libvirt-38" + "id": "libvirt-39" } =20 { @@ -17738,5 +17851,5 @@ ] } ], - "id": "libvirt-38" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies b/tests/= qemucapabilitiesdata/caps_4.0.0.riscv64.replies index 2db59687aa..0cccbdb4e0 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies @@ -4080,18 +4080,120 @@ } =20 { - "execute": "query-tpm-models", + "execute": "qom-list-properties", + "arguments": { + "typename": "virt-machine" + }, "id": "libvirt-34" } =20 { "return": [ + { + "name": "type", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root= node", + "type": "string" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "memory-encryption", + "description": "Set memory encryption object to use", + "type": "string" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + } ], "id": "libvirt-34" } =20 { - "execute": "query-tpm-types", + "execute": "query-tpm-models", "id": "libvirt-35" } =20 @@ -4102,10 +4204,21 @@ } =20 { - "execute": "query-command-line-options", + "execute": "query-tpm-types", "id": "libvirt-36" } =20 +{ + "return": [ + ], + "id": "libvirt-36" +} + +{ + "execute": "query-command-line-options", + "id": "libvirt-37" +} + { "return": [ { @@ -5375,12 +5488,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } =20 { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -5454,12 +5567,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { "execute": "query-qmp-schema", - "id": "libvirt-38" + "id": "libvirt-39" } =20 { @@ -17738,5 +17851,5 @@ ] } ], - "id": "libvirt-38" + "id": "libvirt-39" } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057435; cv=none; d=zoho.com; s=zohoarc; b=CqSUAVJlDusi3iTByvQ4ILdN3325B8rpRd3oLTBl1SKZ+NYkrkFiBGo4aL9KHbeCi+c+Qkli1pjzViMHXQW0Gbnfg+J3PBdaAcF07NrhKHFBJlMHalNmthw5Og7NOnTo66xcq6YnCRjwPQZOJXOihJkpZEuzWUabYREqs+/McmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057435; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=cUZCALxhpImiVDLAtwsyH5pDDjx4SpnCMe9gXkzBuq0=; b=JGbBgWe9iVd8s06HDNUFmj/MqmPt3qBla3SwjfIvh9bD07FnlJtlaUEY1m+NKCoi3UKseyEe/d6zidq1vj/jwlOfqf9E+5nX/IXJ5IGnmOySL6XyJFgR7qdMer6x+lJh5YjoM2HboTwc1lIJWl0cOe53wR8wLYtDPfavlw68C5w= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057435115482.65129856695125; Tue, 28 May 2019 08:30:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5445C3088A65; Tue, 28 May 2019 15:30:33 +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 2972A10027D2; Tue, 28 May 2019 15:30:33 +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 E7C4C1833011; Tue, 28 May 2019 15:30:31 +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 x4SFTHIn015616 for ; Tue, 28 May 2019 11:29:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id A7A5C5C241; Tue, 28 May 2019 15:29:17 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 317725C26D for ; Tue, 28 May 2019 15:29:17 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:29:00 +0200 Message-Id: <20190528152904.25650-8-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/11] conf: Parse and format SMMUv3 IOMMU X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 28 May 2019 15:30:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.html.in | 7 +++-- docs/schemas/domaincommon.rng | 5 ++- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 7 +++++ src/qemu/qemu_domain.c | 3 ++ .../iommu-smmuv3.aarch64-latest.args | 31 +++++++++++++++++++ tests/qemuxml2argvdata/iommu-smmuv3.xml | 15 +++++++++ tests/qemuxml2argvtest.c | 1 + .../iommu-smmuv3.aarch64-latest.xml | 25 +++++++++++++++ tests/qemuxml2xmltest.c | 1 + 11 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/iommu-smmuv3.xml create mode 100644 tests/qemuxml2xmloutdata/iommu-smmuv3.aarch64-latest.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index c843b1d667..22ddcb71d3 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8675,14 +8675,17 @@ qemu-kvm -net nic,model=3D? /dev/null
model

- Currently only the intel model is supported. + Supported values are intel (for Q35 guests) and, + since 5.5.0, smmuv3 (f= or + ARM virt guests).

driver

The driver subelement can be used to configure - additional options: + additional options, some of which might only be available for + certain IOMMU models:

intremap
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 111b85c36f..4bd75e3055 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4375,7 +4375,10 @@ - intel + + intel + smmuv3 + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 006920e954..97ba8bd53a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1122,6 +1122,7 @@ VIR_ENUM_IMPL(virDomainTPMVersion, VIR_ENUM_IMPL(virDomainIOMMUModel, VIR_DOMAIN_IOMMU_MODEL_LAST, "intel", + "smmuv3", ); =20 VIR_ENUM_IMPL(virDomainVsockModel, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index fa0756b634..4c3ab07062 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2296,6 +2296,7 @@ struct _virDomainSEVDef { =20 typedef enum { VIR_DOMAIN_IOMMU_MODEL_INTEL, + VIR_DOMAIN_IOMMU_MODEL_SMMUV3, =20 VIR_DOMAIN_IOMMU_MODEL_LAST } virDomainIOMMUModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b2b9bef772..a11b6d40da 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6967,6 +6967,9 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, break; } =20 + case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); @@ -7612,6 +7615,10 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) virBufferAddLit(&buf, ",iommu=3Don"); break; + + case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, def->iommu->model= ); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 366ebe1604..9802952046 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6135,6 +6135,9 @@ qemuDomainDeviceDefValidateIOMMU(const virDomainIOMMU= Def *iommu, } break; =20 + case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); diff --git a/tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args b/test= s/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args new file mode 100644 index 0000000000..a96669078b --- /dev/null +++ b/tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine virt,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,gic-version=3D2 \ +-m 1024 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/iommu-smmuv3.xml b/tests/qemuxml2argvda= ta/iommu-smmuv3.xml new file mode 100644 index 0000000000..2683ce6459 --- /dev/null +++ b/tests/qemuxml2argvdata/iommu-smmuv3.xml @@ -0,0 +1,15 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 1048576 + 1 + + hvm + + + /usr/bin/qemu-system-aarch64 + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ec58074798..49220733ae 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2813,6 +2813,7 @@ mymain(void) DO_TEST_CAPS_LATEST("intel-iommu-eim"); DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb"); DO_TEST_PARSE_ERROR("intel-iommu-wrong-machine", NONE); + DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64"); =20 DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); DO_TEST_PARSE_ERROR("cpu-hotplug-granularity", diff --git a/tests/qemuxml2xmloutdata/iommu-smmuv3.aarch64-latest.xml b/tes= ts/qemuxml2xmloutdata/iommu-smmuv3.aarch64-latest.xml new file mode 100644 index 0000000000..93e8566dea --- /dev/null +++ b/tests/qemuxml2xmloutdata/iommu-smmuv3.aarch64-latest.xml @@ -0,0 +1,25 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 1048576 + 1048576 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index d1e7fe1015..06d1ad5ec0 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1207,6 +1207,7 @@ mymain(void) DO_TEST_CAPS_LATEST("intel-iommu-caching-mode"); DO_TEST_CAPS_LATEST("intel-iommu-eim"); DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb"); + DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64"); =20 DO_TEST("cpu-check-none", NONE); DO_TEST("cpu-check-partial", NONE); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057445; cv=none; d=zoho.com; s=zohoarc; b=N6l7Awslhy2KubhtjkXd05kILN2x6xLIr48j4F8WvG9c4VC3+GR/XfMwRAI3rk7AyvvRmjve7bgYH87cS6UQxW6gKRyFM+BJLYMqHIs03nUR8B3u+iWgjbEy/K7GfmPpSeG5zAWSj+Y0ImxvJQFbHNnQWPBjv8Kh5gTD+1Dg17E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057445; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rs1qb3/SLWmNWSBx7YmgDiVfqKZf+Sax3xt3v8N7mYA=; b=hNH4SCX0TmgzMA7a2WOGFprp8eaO7ATwPzLJvU4RkaKOyGhRDGgT1xvC22WSOqakghAQFX+vfx/z9RAyQrLIqF09YpPpA9AN0Z3hq9+mSZl5FktVlGdFXmAJxlRYJMvFJKVV2LkXpesFTmDoEHP0G3dscL1KKXGpVIOqEjYcd2o= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057445820455.41739179773435; Tue, 28 May 2019 08:30:45 -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 253ED309B7B9; Tue, 28 May 2019 15:30:44 +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 F0D235DD61; Tue, 28 May 2019 15:30:43 +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 AE47E183301A; Tue, 28 May 2019 15:30:42 +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 x4SFTIiJ015628 for ; Tue, 28 May 2019 11:29:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id B28F279426; Tue, 28 May 2019 15:29:18 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02987BF9EF for ; Tue, 28 May 2019 15:29:17 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:29:01 +0200 Message-Id: <20190528152904.25650-9-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/11] qemu: Add validation for SMMUv3 IOMMU X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.47]); Tue, 28 May 2019 15:30:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9802952046..3290cdae5f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6136,6 +6136,20 @@ qemuDomainDeviceDefValidateIOMMU(const virDomainIOMM= UDef *iommu, break; =20 case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + if (!qemuDomainIsARMVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("IOMMU device: '%s' is only supported with " + "ARM Virt machines"), + virDomainIOMMUModelTypeToString(iommu->model)); + return -1; + } + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_VIRT_IOMMU)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("IOMMU device: '%s' is not supported with " + "this QEMU binary"), + virDomainIOMMUModelTypeToString(iommu->model)); + return -1; + } break; =20 case VIR_DOMAIN_IOMMU_MODEL_LAST: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057441; cv=none; d=zoho.com; s=zohoarc; b=QNJ2sTA1evKraOyZLZOLlHZEmPcQV5NfHBuaDX1Muvkjm0g3LA0mirBMgqiM7T4ebyEc+QSSoCa2Rui8yNBRJPrkILTZAejGcVylAlkanWOtgtVUvFI8Ic5+SZw3BjITsJvYg9TyoZ6Kdq6dpOuPLCR1ieMGLzl4HVxYOkC2EBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057441; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=pv6qDwHf0YMySwSpuG2LeTKU8TrbxTtHv+rFk1Ym94k=; b=L0RBhrp7mtoFjuags9xXtubezImxRKF7no2ukxVy4d2TNzyEToVGzxlK/5wUnRpgIsH2slYa0AYnYX3E76B+N2oUcuPy8tqN/uvIDPiP+eTSWE2rSlej1SJEVu682GSN8MSYwwHnYDGZ9MwkChkLDHpxUdj0De2+LRQkwo8qWvs= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057441893279.50147220491647; Tue, 28 May 2019 08:30:41 -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 E5F5E3003C77; Tue, 28 May 2019 15:30:37 +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 BCA9C5F9A6; Tue, 28 May 2019 15:30:37 +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 788EB183300F; Tue, 28 May 2019 15:30: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 x4SFTJ2H015633 for ; Tue, 28 May 2019 11:29:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 533975C241; Tue, 28 May 2019 15:29:19 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D00EA7943A for ; Tue, 28 May 2019 15:29:18 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:29:02 +0200 Message-Id: <20190528152904.25650-10-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/11] qemu: Move capability checks for IOMMU features 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: , 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.44]); Tue, 28 May 2019 15:30:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" All current IOMMU features are specific to Intel IOMMU, so understandably we check for the corresponding capabilities inside the Intel-specific switch() branch; however, we want to make sure SMMUv3 IOMMU users get an error if they try to enable any of those features in their guest, and performing the capability checks unconditionally is both the easiest way to achieve that, as well as the one least likely to result in us inadvertently letting users enable some new Intel-specific IOMMU feature for ARM guests later on. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 63 +++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3290cdae5f..195124daa3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6105,34 +6105,6 @@ qemuDomainDeviceDefValidateIOMMU(const virDomainIOMM= UDef *iommu, virDomainIOMMUModelTypeToString(iommu->model)); return -1; } - 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; - } - 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; - } - if (iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("iommu: eim is not supported " - "with this QEMU binary")); - return -1; - } - if (iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB))= { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("iommu: device IOTLB is not supported " - "with this QEMU binary")); - return -1; - } break; =20 case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: @@ -6158,6 +6130,41 @@ qemuDomainDeviceDefValidateIOMMU(const virDomainIOMM= UDef *iommu, return -1; } =20 + /* These capability checks ensure we're not trying to use features + * of Intel IOMMU that the QEMU binary does not support, but they + * also make sure we report an error when trying to use features + * that are not implemented by SMMUv3, so they must be here instead + * of inside the switch() statement above */ + + 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; + } + 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; + } + if (iommu->eim !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iommu: eim is not supported " + "with this QEMU binary")); + return -1; + } + if (iommu->iotlb !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iommu: device IOTLB is not supported " + "with this QEMU binary")); + return -1; + } + return 0; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057420; cv=none; d=zoho.com; s=zohoarc; b=DOkurgZApqN1sRFZDxDY7PGnL54UNHtRshAC+QEPkZPJrk+xCMfLVDWCvqVDPiR54rr3rcLFIGk2M2VYA+X32GxENtcXoLqs4I9727D4XTZ72ijfYZ9vDnRs2rKoSB1u7/aBqsHI75gYZwdHP2w3Kr8iKGEDfWv7pU5nTiKJ6dk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057420; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4dGHWXx1Bi/6ktinxfoQovVJg8StID+ld53PmdsrFxg=; b=Py3XhXQfi0PTdfqD0cmfSECw2KTsViQAUvsFdGu/bHvuoJxwMNuz4dsLQZ7lwpJOhipkKS6eheTKMynYkN2tdhsHeBc9y3vMYC7So55W1jvXlowde2yBMWMkhaxOls7JvLsl2Dmo0XOaC6BSlH/bhqIGjux7HmR3uVV68Vzihg4= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057420366677.0199822764835; Tue, 28 May 2019 08:30:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83F65F0D14; Tue, 28 May 2019 15:30: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 57DB02B59F; Tue, 28 May 2019 15:30: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 0BA2E1833004; Tue, 28 May 2019 15:30:18 +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 x4SFTK31015638 for ; Tue, 28 May 2019 11:29:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 220D75C26D; Tue, 28 May 2019 15:29:20 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F97C5C241 for ; Tue, 28 May 2019 15:29:19 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:29:03 +0200 Message-Id: <20190528152904.25650-11-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/11] qemu: Format SMMUv3 IOMMU X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 28 May 2019 15:30:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1575526 Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 4 +++- tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a11b6d40da..59dc134785 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6968,7 +6968,8 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, } =20 case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: - break; + /* There is no -device for SMMUv3, so nothing to be done here */ + return 0; =20 case VIR_DOMAIN_IOMMU_MODEL_LAST: default: @@ -7617,6 +7618,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, break; =20 case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + virBufferAddLit(&buf, ",iommu=3Dsmmuv3"); break; =20 case VIR_DOMAIN_IOMMU_MODEL_LAST: diff --git a/tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args b/test= s/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args index a96669078b..3d4bf3f0d6 100644 --- a/tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args +++ b/tests/qemuxml2argvdata/iommu-smmuv3.aarch64-latest.args @@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ --machine virt,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,gic-version=3D2 \ +-machine virt,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,gic-version=3D2,= iommu=3Dsmmuv3 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:36:24 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559057458; cv=none; d=zoho.com; s=zohoarc; b=PAYAdftn2vU3l6UZkqYkwyKZNzWY6IaGVDO8tOUL5xpkIm62NX9qeCle5iz5KmayFZlH0nTsT3NKQtpA2kRv9y1bCEVUFlVj35TV/Jr550uuVceTjm+zFvwcx3MhxFArGtQ4L7yO6udnAYsA4PBT6Tp/LsikK9booLoiy79DUsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559057458; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8LsqR/r/w0UCMDpuBKLtA8y17Ik3+oLT5tAgIfVkFhI=; b=EZytlS7uUlRj8oI8FXZSTQMNvqJDQfX881ZTyw+xDLR/iij5ww/N8V9lpr6WA+ZSt7n1+mUM2ecvnt0PuZ7wgXfc3XlP1dx0aZGgMbmHV/54YNVz1k+zpWMCrIPedZNgG4Gha8HltK3HjerBOjB3ObWKvlHuzz5jDqXZOIchkUc= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559057458914521.4386521925104; Tue, 28 May 2019 08:30:58 -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 4DDB1300441E; Tue, 28 May 2019 15:30: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 1E3776402E; Tue, 28 May 2019 15:30: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 D3B3F1833018; Tue, 28 May 2019 15:30:56 +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 x4SFTKXi015646 for ; Tue, 28 May 2019 11:29:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id EA9D65C1B5; Tue, 28 May 2019 15:29:20 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74935171EA for ; Tue, 28 May 2019 15:29:20 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 28 May 2019 17:29:04 +0200 Message-Id: <20190528152904.25650-12-abologna@redhat.com> In-Reply-To: <20190528152904.25650-1-abologna@redhat.com> References: <20190528152904.25650-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/11] news: Update for SMMUv3 IOMMU support 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: , 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.44]); Tue, 28 May 2019 15:30:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- docs/news.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 9922cd4de0..792293686f 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -41,6 +41,14 @@
+ + + qemu: Support SMMUv3 IOMMU + + + SMMUv3 is an IOMMU implementation for ARM virt guests. + +
--=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list