From nobody Sat Feb 7 21:20:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1686903306; cv=none; d=zohomail.com; s=zohoarc; b=LZdfv2omJnbmL636iNvZ/pkzQDebjtv/WuPki6joefKN1BKrCh4nqzGJVDHSR/PtZuOHcIICNZ7iDVilQQlSZCyCy6UvQ5Uy7vdBRViJV2qh9lEiFuURH1wz0Bk0gX7TF4PHDKnN7P4S10CfUaJCWdGXJ/x5bixNsin80WS0YOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686903306; 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=h0CO+YijxhJ/FufHRd6+0FfzhIR3kD1CKthByTDTsE8=; b=YMYr2PBrsQqKwjVdkq2LYbS2wvfC8HyA9Fg+iTbiwECZle+P7Gf25bJUqII27esKApswQG/pv9HfLSAGye+J0ovtdotQFzysMQnWka88OLNd5gsKM1UKvzIxAMxxKbto6figLnOUQ5B4pxJqjlnZjH6xT4qYBgcbnaouMuelGxA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1686903306512947.889283726642; Fri, 16 Jun 2023 01:15:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-25gmJusINEesqP7iyOCJSw-1; Fri, 16 Jun 2023 04:14:19 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79EA33810B39; Fri, 16 Jun 2023 08:14:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5726348FB04; Fri, 16 Jun 2023 08:14:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B93D41946594; Fri, 16 Jun 2023 08:14:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 56F461946A52 for ; Fri, 16 Jun 2023 08:14:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 28FEE2026D6A; Fri, 16 Jun 2023 08:14:15 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.45.224.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id A20E82026D49 for ; Fri, 16 Jun 2023 08:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686903305; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=h0CO+YijxhJ/FufHRd6+0FfzhIR3kD1CKthByTDTsE8=; b=dvRKYdJJSpV88w82ieORwnZ6JxU1/0d9km9NtkrFiwZFDumOPKeYOA8fh9rCydJUzWZJPd gCAIxQYUxXgYJptqAZlV2OIqD7/8h1KxFMtspedxt71MW3dUMJb5E78pTqeQZsX8t1V/sy 9fODx3vz22HXmobPCLQ7ZrXS50GapEQ= X-MC-Unique: 25gmJusINEesqP7iyOCJSw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] qemu: Report physical address size in domain capabilities Date: Fri, 16 Jun 2023 10:14:08 +0200 Message-ID: <2acc285771aed0167858bb57f90626f839c94a56.1686903214.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1686903307943100001 Content-Type: text/plain; charset="utf-8" We already report the hosts physical address size in host capabilities, but computing a baseline CPU definition is done from domain capabilities. Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- docs/formatdomaincaps.rst | 6 +++- src/conf/schemas/domaincaps.rng | 3 ++ src/qemu/qemu_capabilities.c | 33 ++++++++++++++++++- .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 + .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 1 + .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 1 + .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 1 + .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 1 + .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 + .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 + .../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + .../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 + tests/domaincapsmock.c | 7 ++++ 37 files changed, 80 insertions(+), 2 deletions(-) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index e93c765aff..9dae941d18 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -187,6 +187,7 @@ CPUs `__. Broadwell Intel + @@ -218,7 +219,10 @@ more details about it: indicated by the ``fallback`` attribute of the ``model`` sub element: ``allow`` means not all specifics were accounted for and thus the CPU a= guest will see may be different; ``forbid`` indicates that the CPU a guest wi= ll see - should match this CPU definition. + should match this CPU definition. The optional ``maxphysaddr`` element + reports physical address size of the host CPU if this value is availabl= e and + applicable for the requested domain type. This is useful for computing + baseline CPU definition which should be compatible with several hosts. ``custom`` The ``mode`` element contains a list of supported CPU models, each desc= ribed by a dedicated ``model`` element. The ``usable`` attribute specifies wh= ether diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.= rng index 28f545bd4b..19bd6f7128 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -132,6 +132,9 @@ + + + diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index cf85d42198..0552486805 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -717,6 +717,8 @@ struct _virQEMUCapsHostCPUData { * probe QEMU or load the cache. */ qemuMonitorCPUModelInfo *info; + /* Physical address size of the host CPU or 0 if unknown or not applic= able. */ + unsigned int physAddrSize; /* Host CPU definition reported in domain capabilities. */ virCPUDef *reported; /* Migratable host CPU definition used for updating guest CPU. */ @@ -2236,6 +2238,7 @@ virQEMUCapsGetHostModel(virQEMUCaps *qemuCaps, static void virQEMUCapsSetHostModel(virQEMUCaps *qemuCaps, virDomainVirtType type, + unsigned int physAddrSize, virCPUDef *reported, virCPUDef *migratable, virCPUDef *full) @@ -2243,12 +2246,34 @@ virQEMUCapsSetHostModel(virQEMUCaps *qemuCaps, virQEMUCapsHostCPUData *cpuData; =20 cpuData =3D &virQEMUCapsGetAccel(qemuCaps, type)->hostCPU; + cpuData->physAddrSize =3D physAddrSize; cpuData->reported =3D reported; cpuData->migratable =3D migratable; cpuData->full =3D full; } =20 =20 +static virCPUMaxPhysAddrDef * +virQEMUCapsGetHostPhysAddr(virQEMUCaps *qemuCaps, + virDomainVirtType type) +{ + virQEMUCapsHostCPUData *cpuData; + virCPUMaxPhysAddrDef *addr =3D NULL; + + cpuData =3D &virQEMUCapsGetAccel(qemuCaps, type)->hostCPU; + + if (cpuData->physAddrSize !=3D 0) { + addr =3D g_new0(virCPUMaxPhysAddrDef, 1); + + addr->mode =3D VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH; + addr->limit =3D cpuData->physAddrSize; + addr->bits =3D -1; + } + + return addr; +} + + bool virQEMUCapsIsArchSupported(virQEMUCaps *qemuCaps, virArch arch) @@ -3805,6 +3830,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, virCPUDef *migCPU =3D NULL; virCPUDef *hostCPU =3D NULL; virCPUDef *fullCPU =3D NULL; + unsigned int physAddrSize =3D 0; size_t i; int rc; =20 @@ -3878,7 +3904,10 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, goto error; } =20 - virQEMUCapsSetHostModel(qemuCaps, type, cpu, migCPU, fullCPU); + if (virQEMUCapsTypeIsAccelerated(type)) + virHostCPUGetPhysAddrSize(&physAddrSize); + + virQEMUCapsSetHostModel(qemuCaps, type, physAddrSize, cpu, migCPU, ful= lCPU); =20 cleanup: virCPUDefFree(cpuExpanded); @@ -6224,6 +6253,8 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCaps *qemuCaps, virCPUDef *cpu =3D virQEMUCapsGetHostModel(qemuCaps, domCaps->virt= type, VIR_QEMU_CAPS_HOST_CPU_= REPORTED); domCaps->cpu.hostModel =3D virCPUDefCopy(cpu); + domCaps->cpu.hostModel->addr =3D virQEMUCapsGetHostPhysAddr(qemuCa= ps, + domCaps-= >virttype); } =20 if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttyp= e, diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_4.2.0-q35.x86_64.xml index 17799b15e3..f408c2a969 100644 --- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml @@ -44,6 +44,7 @@ Skylake-Client-IBRS Intel + diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsda= ta/qemu_4.2.0.ppc64.xml index 6ade73c86a..a3289573bd 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -38,6 +38,7 @@ POWER8 + POWER9 diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_4.2.0.s390x.xml index 81395f43bf..c35bed1326 100644 --- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml @@ -38,6 +38,7 @@ gen15a-base + diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_4.2.0.x86_64.xml index 1b7e4014c5..cbe083f1f1 100644 --- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml @@ -43,6 +43,7 @@ Skylake-Client-IBRS Intel + diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_5.0.0-q35.x86_64.xml index 1278e930d2..6b68d4f2a5 100644 --- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml @@ -44,6 +44,7 @@ Skylake-Client-IBRS Intel + diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml b/tests/domaincapsda= ta/qemu_5.0.0.ppc64.xml index da40c0a876..4b3f490942 100644 --- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml @@ -38,6 +38,7 @@ POWER8 + POWER10 diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_5.0.0.x86_64.xml index 71a01cbcbc..603d842dfe 100644 --- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml @@ -43,6 +43,7 @@ Skylake-Client-IBRS Intel + diff --git a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_5.1.0-q35.x86_64.xml index 1b3fc889d4..cdbbe86ede 100644 --- a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_5.1.0.x86_64.xml index 228b0a17c4..1ef28a71e4 100644 --- a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_5.2.0-q35.x86_64.xml index d1f0ec76aa..46a3a44cdd 100644 --- a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml b/tests/domaincapsda= ta/qemu_5.2.0.ppc64.xml index 33f60ec813..b465ad1030 100644 --- a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml @@ -38,6 +38,7 @@ POWER8 + POWER10 diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_5.2.0.s390x.xml index 1e615dab7c..9dbf118713 100644 --- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml @@ -38,6 +38,7 @@ gen15a-base + diff --git a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_5.2.0.x86_64.xml index 18c2e6b0f7..09db834535 100644 --- a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_6.0.0-q35.x86_64.xml index 2c22538349..b1a2be10e6 100644 --- a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsda= ta/qemu_6.0.0.s390x.xml index f3287347aa..f0a8b196f5 100644 --- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml @@ -38,6 +38,7 @@ gen15a-base + diff --git a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_6.0.0.x86_64.xml index f0ff745f92..693ae0a7f1 100644 --- a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_6.1.0-q35.x86_64.xml index bdaf28ec3e..a161d6aa20 100644 --- a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_6.1.0.x86_64.xml index ded6604e04..8c4f8cc860 100644 --- a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_6.2.0-q35.x86_64.xml index e1f1539140..0449f562df 100644 --- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml b/tests/domaincapsda= ta/qemu_6.2.0.ppc64.xml index 69f6818a81..a9f7aefbc9 100644 --- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml @@ -38,6 +38,7 @@ POWER8 + POWER10 diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_6.2.0.x86_64.xml index 688783d267..fa1f7a2316 100644 --- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_7.0.0-q35.x86_64.xml index ee6abd2f9d..e793278d41 100644 --- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml b/tests/domaincapsda= ta/qemu_7.0.0.ppc64.xml index 349223b689..78f8d3cac4 100644 --- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml @@ -38,6 +38,7 @@ POWER8 + POWER10 diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_7.0.0.x86_64.xml index 45e226e434..1d1505f757 100644 --- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_7.1.0-q35.x86_64.xml index 3fc7ae5551..047763bd43 100644 --- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_7.1.0.ppc64.xml b/tests/domaincapsda= ta/qemu_7.1.0.ppc64.xml index b68fb91c98..f3a436d859 100644 --- a/tests/domaincapsdata/qemu_7.1.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.ppc64.xml @@ -33,6 +33,7 @@ POWER8 + POWER10 diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_7.1.0.x86_64.xml index fe5ac06df3..95452bb0a4 100644 --- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_7.2.0-q35.x86_64.xml index 50615d437e..d0029c65da 100644 --- a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_7.2.0.x86_64.xml index 513042e7f2..fecb7e4a0a 100644 --- a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.0.0-q35.x86_64.xml index c1a1c0b733..ef2637ab26 100644 --- a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.0.0.x86_64.xml index 412847aa62..ebae9e34d6 100644 --- a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.1.0-q35.x86_64.xml index f4a9c43340..0fccb2ef47 100644 --- a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml @@ -44,6 +44,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.1.0.x86_64.xml index 89f7ff5250..f555cca9db 100644 --- a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml @@ -43,6 +43,7 @@ EPYC-Rome AMD + diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c index d382d06e27..cecb333602 100644 --- a/tests/domaincapsmock.c +++ b/tests/domaincapsmock.c @@ -36,6 +36,13 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UN= USED) return 0; } =20 +int +virHostCPUGetPhysAddrSize(unsigned int *size) +{ + *size =3D 64; + return 0; +} + #if WITH_QEMU static bool (*real_virQEMUCapsGetKVMSupportsSecureGuest)(virQEMUCaps *qemu= Caps); =20 --=20 2.41.0 From nobody Sat Feb 7 21:20:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1686903264; cv=none; d=zohomail.com; s=zohoarc; b=Yl9tazWWzeGzkd7vZKR+/0+9jA24HORIiNRFR4CDCZ4UMRHChxABY5o6sAIbS3yHpnInv/x50643Jq8LWfRxwFhXkFGiE+7bwA79Ab6DfremHU4mNnyopF23cDH9jhDtroeaoIBXaUZ4cXsfJh08OfLNGPA3e5juRLo4m7DXCHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686903264; 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=cHgS/X85XSefL16UoB8mSaVPTEnt699am6d9sUfoLY0=; b=AFl4i6K22UEFkUIzuLHUrDgjyoEboDBSwMRJ8VSHG1RihF2WAvi+1K5QNW6LozTOWBtfvXT5TGyDDyAcJW8Db3pA0PskdATCSBdnrLj7iBuFgABXaXxLycofjagInBoDIl9jRWfllUycx7Ubr9OVdIBbmbfKz7o3b1imZE9gZuo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1686903264701830.3510080436356; Fri, 16 Jun 2023 01:14:24 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-225-viCTt4t-NFi9-dyDbJBjCQ-1; Fri, 16 Jun 2023 04:14:19 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D92B85A5A6; Fri, 16 Jun 2023 08:14:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 783AA492B06; Fri, 16 Jun 2023 08:14:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5091C1946594; Fri, 16 Jun 2023 08:14:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 554681946A43 for ; Fri, 16 Jun 2023 08:14:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 362EE422E2; Fri, 16 Jun 2023 08:14:16 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.45.224.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA5B063F4A for ; Fri, 16 Jun 2023 08:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686903263; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cHgS/X85XSefL16UoB8mSaVPTEnt699am6d9sUfoLY0=; b=X7FinSF0d/ALz7RRdb6/l1f1kZQi/VGJ7upkYBJ+23/ZBFmqJxppJK3YZujP6Be3+Dxavd n6d9Qn5cAB9igbuack9PRGwxu/I9GrEQVaLit33RW8mvXAH7vwSiy+sj7VjESQqi/pDFIq 19koEzqohX5dXJFy0ZSQmAIEhg/a+IU= X-MC-Unique: viCTt4t-NFi9-dyDbJBjCQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] qemu: Include maximum physical address size in baseline CPU Date: Fri, 16 Jun 2023 10:14:09 +0200 Message-ID: <502e07ee4772fcfdf5cd398e40eb41195ec08584.1686903214.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1686903265479100001 Content-Type: text/plain; charset="utf-8" The current implementation of virConnectBaselineHypervisorCPU in QEMU driver can provide a CPU definition that will not work on all hosts in case they have different maximum physical address size. So when we get the info from domain capabilities, we need to choose the smallest physical address size for the computed baseline CPU definition. https://bugzilla.redhat.com/show_bug.cgi?id=3D2171860 Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 857fbfb799..c4bd766531 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11778,6 +11778,8 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, virCPUDef *cpu =3D NULL; char *cpustr =3D NULL; g_auto(GStrv) features =3D NULL; + unsigned int physAddrSize =3D 0; + size_t i; =20 virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL); @@ -11845,6 +11847,21 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr con= n, virCPUExpandFeatures(arch, cpu) < 0) goto cleanup; =20 + for (i =3D 0; i < ncpus; i++) { + if (!cpus[i]->addr || cpus[i]->addr->limit =3D=3D 0) + continue; + + if (physAddrSize =3D=3D 0 || cpus[i]->addr->limit < physAddrSize) + physAddrSize =3D cpus[i]->addr->limit; + } + + if (physAddrSize > 0) { + cpu->addr =3D g_new0(virCPUMaxPhysAddrDef, 1); + cpu->addr->mode =3D VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH; + cpu->addr->limit =3D physAddrSize; + cpu->addr->bits =3D -1; + } + cpustr =3D virCPUDefFormat(cpu, NULL); =20 cleanup: --=20 2.41.0 From nobody Sat Feb 7 21:20:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1686903310; cv=none; d=zohomail.com; s=zohoarc; b=dofHwRYddHieQ/auaNwCWmerMOoBnvN4UhjXSpyX9RSTLZ3cHeD2FmkT69hh6xdnVTQPxJd5f82bi7hpXqI7iiR65VUr/j9rZcwWEyblCFlMmwYaHDWzEVVbfdAHea6qC4PUScEEXkmI8LLK37JLomydaFYEbM0+Vr63QGwzbYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686903310; 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=3q2MRzUzbUx4MFQVhNqkQGE/xq5hwf86Jt29m7nZmb4=; b=bG3lavrXSk5BWKy8jfO4r6CZhw47tJAHq5q2jX/5ri2sVPcjl6L0RxuDAbtXp6et76VgER/Ublq59WW/XCU69S9UwXZFsDdOWnwBMc1GuMzqHatb8scB/CfUBpKehwtPCfAszE6cw4t6zLbFOnKCKRIRFkb/4ZIq5Of6nyPDOio= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1686903310505185.24270522951178; Fri, 16 Jun 2023 01:15:10 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-Jp-OZ4nGPvS3SeHK9ssT_g-1; Fri, 16 Jun 2023 04:14:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCB283C11C85; Fri, 16 Jun 2023 08:14:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6DFB2026D6A; Fri, 16 Jun 2023 08:14:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 89B001946594; Fri, 16 Jun 2023 08:14:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5A8EB1946A43 for ; Fri, 16 Jun 2023 08:14:17 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3E607492C38; Fri, 16 Jun 2023 08:14:17 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.45.224.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id F26D6492C1B for ; Fri, 16 Jun 2023 08:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686903309; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3q2MRzUzbUx4MFQVhNqkQGE/xq5hwf86Jt29m7nZmb4=; b=RpBGlWtEr5IZgnBfSIj1ONf0A69/MhXpPsA+xjSHz2RmZg269x4VNRI20o0qnQSlDYtleO VmgMWZdaH98MDoPr8bCvfs+Tz/4jH+6GFKuiRxG84t584hxvicrxEmQFKORJs1t6FkAkw4 fWh3njANrMJ7TEjZDz/RN40v5blel/A= X-MC-Unique: Jp-OZ4nGPvS3SeHK9ssT_g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] NEWS: Mentioned an improvement for virConnectBaselineHypervisorCPU Date: Fri, 16 Jun 2023 10:14:10 +0200 Message-ID: <3c4aec6117bc418fb349c6e9742b25cea225a3d4.1686903214.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1686903312508100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index b1cccee4fa..c520a96177 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -19,6 +19,13 @@ v9.5.0 (unreleased) =20 * **Improvements** =20 + * qemu: Include maximum physical address size in baseline CPU + + When computing a baseline CPU definition for a set of hosts, we need to + include maximum physical address size in the result to make sure it is + compatible with all hosts even if their supported physical address siz= es + differ. + * **Bug fixes** =20 =20 --=20 2.41.0