From nobody Wed May 1 07:41:37 2024 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=1669373591; cv=none; d=zohomail.com; s=zohoarc; b=BOA9zajZwIYPiLWjJWTQU0LAXY8Fawkgstbw95+iuDpzG3QTVsqvivJXcWRqfSpPX6/bTKjWQ3CyvWgjPnMDeq8h8haEWEjDepnDjuDPyJph1cDY/0KanRsfcuI0c4QYw/03nFkz0oE3SvAd0QaaiIIVb+GmqTz5QeZpZjQXHSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669373591; 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=yTwnnQ0aQ8gGBvzhqrLVVeyxFgKbIyBBzJsHLx0yzIw=; b=mzEUfWBHGAWFOH/SklU0TjjcB3AGcdRHQhQ7gR35ar+z9/5gjYYMoSYQJgBk85Z6Kad5E9tdz76tTBSfaL4sYCuR4Wx3G/kH7/96Y8o+LOxJcYdTDMgUZXozHyycxxx2N+51r0AQ1qn0npRKQrKeUOtiSeXbBow5gq8BjzV6Ht4= 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 1669373591502492.38367450603266; Fri, 25 Nov 2022 02:53:11 -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-528-usrjIULqOB-iSTaMfg3cVw-1; Fri, 25 Nov 2022 05:53:05 -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 E7556886C68; Fri, 25 Nov 2022 10:53:02 +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 52F2840C2064; Fri, 25 Nov 2022 10:53:02 +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 F08221946587; Fri, 25 Nov 2022 10:53:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C294E1946586 for ; Fri, 25 Nov 2022 10:53:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AEFE61415137; Fri, 25 Nov 2022 10:53:00 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 790C21415121; Fri, 25 Nov 2022 10:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669373590; 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=yTwnnQ0aQ8gGBvzhqrLVVeyxFgKbIyBBzJsHLx0yzIw=; b=cMuYPa8DUUU1/UbGjl6DU1Yh02adZ3qkut9emuptir6BOo20BqI5HKUoA1VK9mn7NK6alj yM9yM6idneFYDgpuuoW9HSiHBHQNR+gAfkLFtEok4L28v/DJplAxvqnmq1AsafyA7m7pXA bESqWDpD+CzXJ/O9KG9WiF9htYHnr3g= X-MC-Unique: usrjIULqOB-iSTaMfg3cVw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Thomas Huth To: libvir-list@redhat.com Subject: [PATCH v3] cpu_s390: Implement getVendorForModel for IBM Z Date: Fri, 25 Nov 2022 11:52:55 +0100 Message-Id: <20221125105255.247945-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1669373593417100001 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. Reviewed-by: Jiri Denemark Signed-off-by: Boris Fiuczynski Signed-off-by: Thomas Huth --- v3: Use STRPREFIX() for the checks (thanks to Jiri for the hint!) 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..81a1513ecb 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 (STRPREFIX(modelName, "z") || STRPREFIX(modelName, "gen")) + 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