From nobody Sat Feb 7 09:36:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1651685283289582.232319865233; Wed, 4 May 2022 10:28:03 -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-340-KBfiSVKzOMS_5KTX4eFb_A-1; Wed, 04 May 2022 13:27:39 -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 AC5F486B8C5; Wed, 4 May 2022 17:27:36 +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 981644643C1; Wed, 4 May 2022 17:27:36 +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 A4B831947078; Wed, 4 May 2022 17:27:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 10F7B1947043 for ; Wed, 4 May 2022 17:27:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0214740CF8EF; Wed, 4 May 2022 17:27:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F19D640CF8EA for ; Wed, 4 May 2022 17:27:33 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1783C1D32370 for ; Wed, 4 May 2022 17:27:33 +0000 (UTC) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-589-YYQ1QekaMpG0KDGVpY8a5Q-1; Wed, 04 May 2022 13:27:31 -0400 Received: by mail-oi1-f177.google.com with SMTP id m11so1840492oib.11 for ; Wed, 04 May 2022 10:27:31 -0700 (PDT) Received: from balboa.ibmuc.com (201-1-57-208.dsl.telesp.net.br. [201.1.57.208]) by smtp.gmail.com with ESMTPSA id i23-20020a4addd7000000b0035eb4e5a6d6sm6226581oov.44.2022.05.04.10.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 10:27:29 -0700 (PDT) X-MC-Unique: KBfiSVKzOMS_5KTX4eFb_A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: YYQ1QekaMpG0KDGVpY8a5Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MVN06nfTYLN1HPSZCFVfr9SCIG2c2f69sZyxQ1OWfds=; b=swAaVT00jZtW1FRF5TRat8bsN39nO3PslfUltI1U2R/lkP9/u/ImnrjoC/OQpHw3yn 5LFVCnMFjvRmtL6+79jjW5osFUtTX/KoMBHw+185EVG3/Di+gvDM4IvaaD3D9mrYGgC/ 5rppLOmLA2YFFc0m7PGBUj0mbtaNTA2JA3/vkA+6C7FNuu1fwNXOr5mb86OkCC0jPJM/ 5V8O7NtRDWtmqFlYvlhET2weHEvw1oyrEUO4ajH+7n61iOmUSbDtscphvUbKabEPbIS1 HM61UOJd2y/Etm2jVl8Xv6mKCzrnnKleafLQNSeDadcCGhmfGAO7XQ7kzd+4/JcpGhmb kb5A== X-Gm-Message-State: AOAM533BqCluJy1JcwHd2HRPOZQHmbSbnRPKpQzLliSM3vJfthAzvLBf NZWzdA9JrCXub85gevsJFpb7NJJDx6E= X-Google-Smtp-Source: ABdhPJz3XX5XPXiqbYtMOJBqkJGHq5w19ZY2Czy89zIAGiExoPfVyd6U813dS8/GmigObMZpxfrlRA== X-Received: by 2002:a05:6808:f08:b0:325:c68e:7ae8 with SMTP id m8-20020a0568080f0800b00325c68e7ae8mr277231oiw.292.1651685249503; Wed, 04 May 2022 10:27:29 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 3/3] cpu_ppc64: add support for host-model on POWER10 Date: Wed, 4 May 2022 14:27:18 -0300 Message-Id: <20220504172718.273781-4-danielhb413@gmail.com> In-Reply-To: <20220504172718.273781-1-danielhb413@gmail.com> References: <20220504172718.273781-1-danielhb413@gmail.com> 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.84 on 10.11.54.1 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: , Cc: danielhb413@gmail.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1651685284540100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Daniel Henrique Barboza --- src/cpu/cpu_ppc64.c | 8 ++--- .../pseries-cpu-compat-power10.args | 32 +++++++++++++++++++ .../pseries-cpu-compat-power10.err | 1 + .../pseries-cpu-compat-power10.xml | 21 ++++++++++++ tests/qemuxml2argvtest.c | 11 +++++++ tests/testutilshostcpus.h | 11 +++++++ tests/testutilsqemu.c | 4 ++- tests/testutilsqemu.h | 1 + 8 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxml2argvdata/pseries-cpu-compat-power10.args create mode 100644 tests/qemuxml2argvdata/pseries-cpu-compat-power10.err create mode 100644 tests/qemuxml2argvdata/pseries-cpu-compat-power10.xml diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 314d2f7c86..087635404d 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -88,22 +88,22 @@ ppc64CheckCompatibilityMode(const char *host_model, if (!compat_mode) return VIR_CPU_COMPARE_IDENTICAL; =20 - /* Valid host CPUs: POWER6, POWER7, POWER8, POWER9 */ + /* Valid host CPUs: POWER6, POWER7, POWER8, POWER9, POWER10 */ if (!STRPREFIX(host_model, "POWER") || !(tmp =3D (char *) host_model + strlen("POWER")) || virStrToLong_i(tmp, NULL, 10, &host) < 0 || - host < 6 || host > 9) { + host < 6 || host > 10) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Host CPU does not support compatibility modes")); return VIR_CPU_COMPARE_ERROR; } =20 - /* Valid compatibility modes: power6, power7, power8, power9 */ + /* Valid compatibility modes: power6, power7, power8, power9, power10 = */ if (!STRPREFIX(compat_mode, "power") || !(tmp =3D (char *) compat_mode + strlen("power")) || virStrToLong_i(tmp, NULL, 10, &compat) < 0 || - compat < 6 || compat > 9) { + compat < 6 || compat > 10) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown compatibility mode %s"), compat_mode); diff --git a/tests/qemuxml2argvdata/pseries-cpu-compat-power10.args b/tests= /qemuxml2argvdata/pseries-cpu-compat-power10.args new file mode 100644 index 0000000000..cc485d960f --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-cpu-compat-power10.args @@ -0,0 +1,32 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ +-machine pseries,usb=3Doff,dump-guest-core=3Doff,max-cpu-compat=3Dpower10 \ +-accel kvm \ +-cpu host \ +-m 256 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-usb \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D805306368 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/pseries-cpu-compat-power10.err b/tests/= qemuxml2argvdata/pseries-cpu-compat-power10.err new file mode 100644 index 0000000000..f2322ccea5 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-cpu-compat-power10.err @@ -0,0 +1 @@ +the CPU is incompatible with host CPU diff --git a/tests/qemuxml2argvdata/pseries-cpu-compat-power10.xml b/tests/= qemuxml2argvdata/pseries-cpu-compat-power10.xml new file mode 100644 index 0000000000..1414f5bb75 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-cpu-compat-power10.xml @@ -0,0 +1,21 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 4 + + hvm + + + power10 + + + + /usr/bin/qemu-system-ppc64 + +
+ + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1f080daba7..78e7d89f8e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2209,6 +2209,17 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_VTY); qemuTestSetHostCPU(&driver, driver.hostarch, NULL); =20 + DO_TEST_FAILURE("pseries-cpu-compat-power10", + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_KVM); + + qemuTestSetHostCPU(&driver, driver.hostarch, cpuPower10); + DO_TEST("pseries-cpu-compat-power10", + QEMU_CAPS_KVM, + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_DEVICE_SPAPR_VTY); + qemuTestSetHostCPU(&driver, driver.hostarch, NULL); + qemuTestSetHostArch(&driver, VIR_ARCH_NONE); =20 DO_TEST("pseries-panic-missing", diff --git a/tests/testutilshostcpus.h b/tests/testutilshostcpus.h index cf0fc833e1..e38d7c8b5a 100644 --- a/tests/testutilshostcpus.h +++ b/tests/testutilshostcpus.h @@ -114,6 +114,15 @@ static virCPUDef cpuPower9Data =3D { .threads =3D 1, }; =20 +static virCPUDef cpuPower10Data =3D { + .type =3D VIR_CPU_TYPE_HOST, + .arch =3D VIR_ARCH_PPC64, + .model =3D (char *) "POWER10", + .sockets =3D 1, + .cores =3D 16, + .threads =3D 1, +}; + static virCPUDef cpuAarch64Data =3D { .type =3D VIR_CPU_TYPE_HOST, .arch =3D VIR_ARCH_AARCH64, @@ -154,6 +163,8 @@ testUtilsHostCpusGetDefForModel(const char *model) return virCPUDefCopy(&cpuPower8Data); else if (STREQ(model, "POWER9")) return virCPUDefCopy(&cpuPower9Data); + else if (STREQ(model, "POWER10")) + return virCPUDefCopy(&cpuPower10Data); =20 return NULL; } diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 105b41cbeb..8f1b72890a 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -22,6 +22,7 @@ virCPUDef *cpuDefault; virCPUDef *cpuHaswell; virCPUDef *cpuPower8; virCPUDef *cpuPower9; +virCPUDef *cpuPower10; =20 =20 static const char *qemu_emulators[VIR_ARCH_LAST] =3D { @@ -567,7 +568,8 @@ int qemuTestDriverInit(virQEMUDriver *driver) if (!(cpuDefault =3D virCPUDefCopy(&cpuDefaultData)) || !(cpuHaswell =3D virCPUDefCopy(&cpuHaswellData)) || !(cpuPower8 =3D virCPUDefCopy(&cpuPower8Data)) || - !(cpuPower9 =3D virCPUDefCopy(&cpuPower9Data))) + !(cpuPower9 =3D virCPUDefCopy(&cpuPower9Data)) || + !(cpuPower10 =3D virCPUDefCopy(&cpuPower10Data))) return -1; =20 if (virMutexInit(&driver->lock) < 0) diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 187f9b7cd3..76a6954019 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -106,6 +106,7 @@ extern virCPUDef *cpuDefault; extern virCPUDef *cpuHaswell; extern virCPUDef *cpuPower8; extern virCPUDef *cpuPower9; +extern virCPUDef *cpuPower10; =20 void qemuTestSetHostArch(virQEMUDriver *driver, virArch arch); --=20 2.35.1