From nobody Mon Nov 25 12:36:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1603987663; cv=none; d=zohomail.com; s=zohoarc; b=Byxk8iZ4i2kQVb8yCJshfc7dB3x7SJQlR00bBuQTPa7TSBLBd7wsolxKwJzKs43LF9aDLwAbCZC+v892+QUd6o1emjdLmNPamF3LFhcsz0JmIRuXjSrPKMhKYIOxICfQlpqEFr21GbE5XPg10blIVWVb7IqvuKoR8QObEhBo9lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603987663; 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; bh=p2WI5sWP83z7tMeG2zPff1L8FQa9pcYeiiViLBgzU9c=; b=fjMNeoB+gfni1AsL4so3IbHXUM9R+ZzR7CONIFI2u3wjJMC3oQnll+TTB4F4nT7Q560LbOkd2ClJ9geHMse/P8vLg1qSpl2H+uBQ4V5jUkY9PVi7zUbnjriiASiuU9z++6QRN4V78AM9whfMcdiQb2Hic788mBR7WyY8HvaIcEk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603987662991574.1470825757547; Thu, 29 Oct 2020 09:07:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-BU44PJczNJ2Em8t2-fEKGg-1; Thu, 29 Oct 2020 12:07:38 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 140E4804746; Thu, 29 Oct 2020 16:07:31 +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 A3D976198B; Thu, 29 Oct 2020 16:07:30 +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 DC6BC181A870; Thu, 29 Oct 2020 16:07:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09TFtndL029176 for ; Thu, 29 Oct 2020 11:55:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 643F810F8E23; Thu, 29 Oct 2020 15:55:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6020910FFE69 for ; Thu, 29 Oct 2020 15:55:47 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0585F858280 for ; Thu, 29 Oct 2020 15:55:47 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-5Q_EzPNLNrC-Nd91N-LU5w-1; Thu, 29 Oct 2020 11:55:44 -0400 Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0FFF0ACA0 for ; Thu, 29 Oct 2020 15:55:43 +0000 (UTC) X-MC-Unique: BU44PJczNJ2Em8t2-fEKGg-1 X-MC-Unique: 5Q_EzPNLNrC-Nd91N-LU5w-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Subject: [RFC PATCH 2/2] qemu: Add support for max physical address size From: Dario Faggioli To: libvir-list@redhat.com Date: Thu, 29 Oct 2020 15:55:42 +0000 Message-ID: <160398694221.12832.16596704523899993962.stgit@toolbox-dario-user-dev> In-Reply-To: <160398560496.12832.7946138363908682671.stgit@toolbox-dario-user-dev> References: <160398560496.12832.7946138363908682671.stgit@toolbox-dario-user-dev> User-Agent: StGit/0.23-36-gc01b MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This patch maps /domain/cpu/maxphysaddr into -cpu parameters: - becomes host-phys-bits=3Don - becomes phys-bits=3D42 Passthrough mode can only be used if the chosen CPU model is 'host-passthrough'. The feature is available since QEMU 2.7.0. Signed-off-by: Dario Faggioli --- src/qemu/qemu_capabilities.c | 2 + src/qemu/qemu_capabilities.h | 1=20 src/qemu/qemu_command.c | 28 ++++++++++++ src/qemu/qemu_domain.c | 46 ++++++++++++++++= ++++ tests/qemuxml2argvdata/cpu-phys-bits-emulate.args | 29 +++++++++++++ tests/qemuxml2argvdata/cpu-phys-bits-emulate.xml | 20 +++++++++ tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args | 30 +++++++++++++ tests/qemuxml2argvdata/cpu-phys-bits-emulate2.xml | 20 +++++++++ tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err | 1=20 tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml | 20 +++++++++ .../cpu-phys-bits-passthrough.args | 29 +++++++++++++ .../qemuxml2argvdata/cpu-phys-bits-passthrough.xml | 20 +++++++++ .../cpu-phys-bits-passthrough2.err | 1=20 .../cpu-phys-bits-passthrough2.xml | 20 +++++++++ .../cpu-phys-bits-passthrough3.err | 1=20 .../cpu-phys-bits-passthrough3.xml | 20 +++++++++ tests/qemuxml2argvtest.c | 7 +++ 17 files changed, 295 insertions(+) create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate.args create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate.xml create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate2.xml create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough.args create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough.xml create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a67fb785b5..70adb423f1 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -603,6 +603,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio-balloon.free-page-reporting", "block-export-add", "netdev.vhost-vdpa", + "host-phys-bits", ); =20 =20 @@ -1679,6 +1680,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjec= tPropsMaxCPU[] =3D { { "unavailable-features", QEMU_CAPS_CPU_UNAVAILABLE_FEATURES }, { "kvm-no-adjvtime", QEMU_CAPS_CPU_KVM_NO_ADJVTIME }, { "migratable", QEMU_CAPS_CPU_MIGRATABLE }, + { "host-phys-bits", QEMU_CAPS_CPU_PHYS_BITS }, }; =20 static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 047ba8a0ee..0fe97d2fd1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -583,6 +583,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_VIRTIO_BALLOON_FREE_PAGE_REPORTING, /*virtio balloon free-pa= ge-reporting */ QEMU_CAPS_BLOCK_EXPORT_ADD, /* 'block-export-add' command is supported= */ QEMU_CAPS_NETDEV_VHOST_VDPA, /* -netdev vhost-vdpa*/ + QEMU_CAPS_CPU_PHYS_BITS, /* -cpu phys-bits=3D42 or host-phys-bits=3Don= */ =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 7847706594..d58f80547e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6507,6 +6507,34 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, virBufferAddLit(&buf, ",l3-cache=3Doff"); } =20 + if (def->cpu && def->cpu->addr) { + virCPUMaxPhysAddrDefPtr addr =3D def->cpu->addr; + + switch (addr->mode) { + case VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH: + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_PHYS_BITS)) + virBufferAddLit(&buf, ",host-phys-bits=3Don"); + else + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Setting host physical address bits is " + "not supported by this QEMU")); + break; + + case VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE: + if (addr->bits !=3D -1 && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_PHYS_BITS)) + virBufferAsprintf(&buf, ",phys-bits=3D%d", addr->bits); + else + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Physical address bits unspecified or " + "setting it not supported by this QEMU")); + break; + + case VIR_CPU_MAX_PHYS_ADDR_MODE_LAST: + break; + } + } + cpu =3D virBufferContentAndReset(&cpu_buf); cpu_flags =3D virBufferContentAndReset(&buf); =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d7dbca487a..e9f20d82a1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4051,6 +4051,52 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def, } } =20 + if (def->cpu->addr) { + virCPUMaxPhysAddrDefPtr addr =3D def->cpu->addr; + + if (!ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("CPU maximum physical address bits specificat= ion " + "is not supported for '%s' architecture"), + virArchToString(def->os.arch)); + return -1; + } + + switch (addr->mode) { + case VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH: + if (def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTHROUGH) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("CPU maximum physical address bits mode '= %s' " + "can only be used with '%s' CPUs"), + virCPUMaxPhysAddrModeTypeToString(addr->mod= e), + virCPUModeTypeToString(VIR_CPU_MODE_HOST_PA= SSTHROUGH)); + return -1; + } + if (addr->bits !=3D -1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("CPU maximum physical address bits number= " + "specification cannot be used with " + "mode=3D'%s'"), + virCPUMaxPhysAddrModeTypeToString(VIR_CPU_M= AX_PHYS_ADDR_MODE_PASSTHROUGH)); + return -1; + } + break; + + case VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE: + if (addr->bits =3D=3D -1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("if using CPU maximum physical address " + "mode=3D'%s', bits=3D must be specified t= oo"), + virCPUMaxPhysAddrModeTypeToString(VIR_CPU_M= AX_PHYS_ADDR_MODE_EMULATE)); + return -1; + } + break; + + case VIR_CPU_MAX_PHYS_ADDR_MODE_LAST: + break; + } + } + for (i =3D 0; i < def->cpu->nfeatures; i++) { virCPUFeatureDefPtr feature =3D &def->cpu->features[i]; =20 diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate.args b/tests/qemu= xml2argvdata/cpu-phys-bits-emulate.args new file mode 100644 index 0000000000..5627b41b25 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate.args @@ -0,0 +1,29 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-foo \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-foo/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-foo/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-foo/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name foo \ +-S \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu host,phys-bits=3D42 \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-foo/monitor.soc= k,server,\ +nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate.xml b/tests/qemux= ml2argvdata/cpu-phys-bits-emulate.xml new file mode 100644 index 0000000000..f8bd63bc68 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args b/tests/qem= uxml2argvdata/cpu-phys-bits-emulate2.args new file mode 100644 index 0000000000..f105f96f02 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args @@ -0,0 +1,30 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-foo \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-foo/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-foo/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-foo/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name foo \ +-S \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu core2duo,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,+tm2,+cx16,+xtp= r,\ ++lahf_lm,phys-bits=3D42 \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-foo/monitor.soc= k,server,\ +nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.xml b/tests/qemu= xml2argvdata/cpu-phys-bits-emulate2.xml new file mode 100644 index 0000000000..188b3066ed --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err b/tests/qemu= xml2argvdata/cpu-phys-bits-emulate3.err new file mode 100644 index 0000000000..5e21998259 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.err @@ -0,0 +1 @@ +unsupported configuration: if using CPU maximum physical address mode=3D'e= mulate', bits=3D must be specified too diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml b/tests/qemu= xml2argvdata/cpu-phys-bits-emulate3.xml new file mode 100644 index 0000000000..30a14894dd --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate3.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough.args b/tests/= qemuxml2argvdata/cpu-phys-bits-passthrough.args new file mode 100644 index 0000000000..a4f3f55bb9 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough.args @@ -0,0 +1,29 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-foo \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-foo/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-foo/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-foo/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name foo \ +-S \ +-machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu host,host-phys-bits=3Don \ +-m 214 \ +-realtime mlock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-foo/monitor.soc= k,server,\ +nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-usb \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough.xml b/tests/q= emuxml2argvdata/cpu-phys-bits-passthrough.xml new file mode 100644 index 0000000000..db570beb8d --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err b/tests/= qemuxml2argvdata/cpu-phys-bits-passthrough2.err new file mode 100644 index 0000000000..22009cc6e6 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err @@ -0,0 +1 @@ +unsupported configuration: CPU maximum physical address bits mode 'passthr= ough' can only be used with 'host-passthrough' CPUs diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml b/tests/= qemuxml2argvdata/cpu-phys-bits-passthrough2.xml new file mode 100644 index 0000000000..511bbf9949 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err b/tests/= qemuxml2argvdata/cpu-phys-bits-passthrough3.err new file mode 100644 index 0000000000..28f2e43432 --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err @@ -0,0 +1 @@ +unsupported configuration: CPU maximum physical address bits number specif= ication cannot be used with mode=3D'passthrough' diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml b/tests/= qemuxml2argvdata/cpu-phys-bits-passthrough3.xml new file mode 100644 index 0000000000..a94e567dcb --- /dev/null +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml @@ -0,0 +1,20 @@ + + foo + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c5a0095e0d..fd17fea744 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3409,6 +3409,13 @@ mymain(void) =20 DO_TEST_CAPS_LATEST("virtio-9p-multidevs"); =20 + DO_TEST("cpu-phys-bits-passthrough", QEMU_CAPS_KVM, QEMU_CAPS_CPU_PHYS= _BITS); + DO_TEST("cpu-phys-bits-emulate", QEMU_CAPS_KVM, QEMU_CAPS_CPU_PHYS_BIT= S); + DO_TEST("cpu-phys-bits-emulate2", QEMU_CAPS_KVM, QEMU_CAPS_CPU_PHYS_BI= TS); + DO_TEST_PARSE_ERROR("cpu-phys-bits-emulate3", QEMU_CAPS_KVM); + DO_TEST_PARSE_ERROR("cpu-phys-bits-passthrough2", QEMU_CAPS_KVM); + DO_TEST_PARSE_ERROR("cpu-phys-bits-passthrough3", QEMU_CAPS_KVM); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20