From nobody Sat Feb 7 23:47:58 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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=1669369024; cv=none; d=zohomail.com; s=zohoarc; b=Ao5bw4fMvkrXfAZ2+eL/nftcqKTThZR5uB56+3aAWKCBaLAIi11FcrFluLUFOzMyplC3I04R6GqPCa7xzjdmMTf+8FkWbT5RfyWnoUF75MW7BzOdTCt08uC1+PzNL/DcNgg+T/x+xEJwtnKKKHU6nvvgwiiZdD79YhWYi2thJxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669369024; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=RnO/b28p2RFzmehOAlg+jgWgeUpxtFW5PN9mrw0NPCs=; b=W4cdIqMvNOXQUZfHHzgOJG0ZwlxXzAF/Z++tvGiM7y5GVNrTENIGhF5atwgrh3e9SpFNhkECas+g1BllQdwhOiP/OSXL7B3ULft1YHq//GEz/ipD/L66xXsZMCdWTI+qITdrZzYERQqdVNK9OZfOUX6IcCDfJyxj/UBDPHTErdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1669369024050496.82137837125015; Fri, 25 Nov 2022 01:37:04 -0800 (PST) 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-621-2FwbQ6iMMh6iWz8czgPyDQ-1; Fri, 25 Nov 2022 04:36:33 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 30E4185A59D; Fri, 25 Nov 2022 09:36:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05C0E40C2088; Fri, 25 Nov 2022 09:36:28 +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 B44A41946587; Fri, 25 Nov 2022 09:36:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 863731946586 for ; Fri, 25 Nov 2022 09:36:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 70D26111F3D7; Fri, 25 Nov 2022 09:36:27 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70C63111F3C1; Fri, 25 Nov 2022 09:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669369023; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RnO/b28p2RFzmehOAlg+jgWgeUpxtFW5PN9mrw0NPCs=; b=KUHkZHoNWOykkheWNPjlBeFJNRVrdaiigJPuahUjM46AyChdtJMVTAZAuWUIo7TQGGI8LA wVgVnLoFaT0pD8Oc2xAjMAMCCPC5XFf+zn+ulELuV9LgJ3FgOB5lxcL1YxWcPfnARkPTgP zufCnXRq2Q7HIkhFniyeD1BrQr6GrtY= X-MC-Unique: 2FwbQ6iMMh6iWz8czgPyDQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Thomas Huth To: libvir-list@redhat.com Subject: [PATCH v2] cpu_s390: Implement getVendorForModel for IBM Z Date: Fri, 25 Nov 2022 10:36:22 +0100 Message-Id: <20221125093622.234989-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: Boris Fiuczynski Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1669369025361100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When running "virsh domcapabilities" on a s390x host, all the CPU models show up with vendor=3D'unknown' - which sounds kind of weird since the vendor of these mainframe CPUs is well known: IBM. All CPUs starting with either "z" or "gen" match a real mainframe CPU by IBM, so let's return the string "IBM" for those now. The only remaining ones are now the artifical "qemu" and "max" models from QEMU itself, so it should be OK to get an "unknown" vendor for those two. Thanks to Boris Fiuczynski for helping with the domaincapsdata! Reviewed-by: Boris Fiuczynski Signed-off-by: Thomas Huth Reviewed-by: Jiri Denemark --- src/cpu/cpu_s390.c | 11 ++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 144 +++++++++++----------- tests/domaincapsdata/qemu_5.2.0.s390x.xml | 144 +++++++++++----------- tests/domaincapsdata/qemu_6.0.0.s390x.xml | 144 +++++++++++----------- 4 files changed, 227 insertions(+), 216 deletions(-) diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index d908a83928..7416ec6dc5 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -109,6 +109,16 @@ virCPUs390ValidateFeatures(virCPUDef *cpu) } =20 =20 +static const char * +virCPUs390GetVendorForModel(const char *modelName) +{ + if (modelName[0] =3D=3D 'z' || STREQLEN(modelName, "gen", 3)) + return "IBM"; + + return NULL; +} + + struct cpuArchDriver cpuDriverS390 =3D { .name =3D "s390", .arch =3D archs, @@ -119,4 +129,5 @@ struct cpuArchDriver cpuDriverS390 =3D { .baseline =3D NULL, .update =3D virCPUs390Update, .validateFeatures =3D virCPUs390ValidateFeatures, + .getVendorForModel =3D virCPUs390GetVendorForModel, }; diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_4.2.0.s390x.xml index 4f176e2d37..66841881a1 100644 --- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml @@ -83,79 +83,79 @@ - z800-base - z890.2-base - z9EC.2 - z13.2 - z9BC-base - z990.5-base - z890.2 - z890 - z9BC - z13 - z196 - z13s - z990.3 - z13s-base - z9EC - gen15a - z14ZR1-base - z14.2-base - z900.3-base - z13.2-base - z196.2-base - zBC12-base - z9BC.2-base - z900.2-base - z9EC.3 - zEC12 - z900 - z114-base - zEC12-base - z10EC.2 - z10EC-base - z900.3 - z14ZR1 - z10BC - z10BC.2-base - z990.2 - z9BC.2 - z990 - z14 - gen15b-base - z990.4 + z800-base + z890.2-base + z9EC.2 + z13.2 + z9BC-base + z990.5-base + z890.2 + z890 + z9BC + z13 + z196 + z13s + z990.3 + z13s-base + z9EC + gen15a + z14ZR1-base + z14.2-base + z900.3-base + z13.2-base + z196.2-base + zBC12-base + z9BC.2-base + z900.2-base + z9EC.3 + zEC12 + z900 + z114-base + zEC12-base + z10EC.2 + z10EC-base + z900.3 + z14ZR1 + z10BC + z10BC.2-base + z990.2 + z9BC.2 + z990 + z14 + gen15b-base + z990.4 max - z10EC.2-base - gen15a-base - z800 - zEC12.2 - z10EC - z990.2-base - z900-base - z10BC.2 - z9EC-base - z9EC.3-base - z114 - z890.3 - z196-base - z9EC.2-base - z196.2 - z14.2 - z990-base - z900.2 - z890-base - z10EC.3 - z14-base - z990.4-base - z10EC.3-base - z10BC-base - z13-base - z990.3-base - zEC12.2-base - zBC12 - z890.3-base - z990.5 - gen15b + z10EC.2-base + gen15a-base + z800 + zEC12.2 + z10EC + z990.2-base + z900-base + z10BC.2 + z9EC-base + z9EC.3-base + z114 + z890.3 + z196-base + z9EC.2-base + z196.2 + z14.2 + z990-base + z900.2 + z890-base + z10EC.3 + z14-base + z990.4-base + z10EC.3-base + z10BC-base + z13-base + z990.3-base + zEC12.2-base + zBC12 + z890.3-base + z990.5 + gen15b qemu diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_5.2.0.s390x.xml index 760f514d7b..31ddbfbc75 100644 --- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml @@ -85,79 +85,79 @@ - z800-base - z890.2-base - z9EC.2 - z13.2 - z990.5-base - z9BC-base - z890.2 - z890 - z9BC - z13 - z196 - z13s - z990.3 - z13s-base - z9EC - gen15a - z14ZR1-base - z14.2-base - z900.3-base - z13.2-base - z196.2-base - zBC12-base - z9BC.2-base - z900.2-base - z9EC.3 - zEC12 - z900 - z114-base - zEC12-base - z10EC.2 - z10EC-base - z900.3 - z14ZR1 - z10BC - z10BC.2-base - z9BC.2 - z990 - z990.2 - z14 - gen15b-base - z990.4 + z800-base + z890.2-base + z9EC.2 + z13.2 + z990.5-base + z9BC-base + z890.2 + z890 + z9BC + z13 + z196 + z13s + z990.3 + z13s-base + z9EC + gen15a + z14ZR1-base + z14.2-base + z900.3-base + z13.2-base + z196.2-base + zBC12-base + z9BC.2-base + z900.2-base + z9EC.3 + zEC12 + z900 + z114-base + zEC12-base + z10EC.2 + z10EC-base + z900.3 + z14ZR1 + z10BC + z10BC.2-base + z9BC.2 + z990 + z990.2 + z14 + gen15b-base + z990.4 max - z990.2-base - z10EC.2-base - gen15a-base - z800 - z10EC - zEC12.2 - z900-base - z10BC.2 - z9EC-base - z9EC.3-base - z114 - z890.3 - z196-base - z9EC.2-base - z196.2 - z14.2 - z990-base - z900.2 - z10EC.3 - z890-base - z14-base - z990.4-base - z10EC.3-base - z10BC-base - z13-base - z990.3-base - zEC12.2-base - zBC12 - z890.3-base - z990.5 - gen15b + z990.2-base + z10EC.2-base + gen15a-base + z800 + z10EC + zEC12.2 + z900-base + z10BC.2 + z9EC-base + z9EC.3-base + z114 + z890.3 + z196-base + z9EC.2-base + z196.2 + z14.2 + z990-base + z900.2 + z10EC.3 + z890-base + z14-base + z990.4-base + z10EC.3-base + z10BC-base + z13-base + z990.3-base + zEC12.2-base + zBC12 + z890.3-base + z990.5 + gen15b qemu diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsda= ta/qemu_6.0.0.s390x.xml index b1968668db..1cb19e051b 100644 --- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml @@ -86,79 +86,79 @@ - z800-base - z890.2-base - z9EC.2 - z13.2 - z990.5-base - z9BC-base - z890.2 - z890 - z9BC - z13 - z196 - z13s - z990.3 - z13s-base - z9EC - gen15a - z14ZR1-base - z14.2-base - z900.3-base - z13.2-base - z196.2-base - zBC12-base - z9BC.2-base - z900.2-base - z9EC.3 - zEC12 - z900 - z114-base - zEC12-base - z10EC.2 - z10EC-base - z900.3 - z14ZR1 - z10BC - z10BC.2-base - z9BC.2 - z990 - z990.2 - z14 - gen15b-base - z990.4 + z800-base + z890.2-base + z9EC.2 + z13.2 + z990.5-base + z9BC-base + z890.2 + z890 + z9BC + z13 + z196 + z13s + z990.3 + z13s-base + z9EC + gen15a + z14ZR1-base + z14.2-base + z900.3-base + z13.2-base + z196.2-base + zBC12-base + z9BC.2-base + z900.2-base + z9EC.3 + zEC12 + z900 + z114-base + zEC12-base + z10EC.2 + z10EC-base + z900.3 + z14ZR1 + z10BC + z10BC.2-base + z9BC.2 + z990 + z990.2 + z14 + gen15b-base + z990.4 max - z10EC.2-base - gen15a-base - z800 - z10EC - zEC12.2 - z990.2-base - z900-base - z10BC.2 - z9EC-base - z9EC.3-base - z114 - z890.3 - z196-base - z9EC.2-base - z196.2 - z14.2 - z990-base - z900.2 - z890-base - z10EC.3 - z14-base - z990.4-base - z10EC.3-base - z10BC-base - z13-base - z990.3-base - zEC12.2-base - zBC12 - z890.3-base - z990.5 - gen15b + z10EC.2-base + gen15a-base + z800 + z10EC + zEC12.2 + z990.2-base + z900-base + z10BC.2 + z9EC-base + z9EC.3-base + z114 + z890.3 + z196-base + z9EC.2-base + z196.2 + z14.2 + z990-base + z900.2 + z890-base + z10EC.3 + z14-base + z990.4-base + z10EC.3-base + z10BC-base + z13-base + z990.3-base + zEC12.2-base + zBC12 + z890.3-base + z990.5 + gen15b qemu --=20 2.31.1