From nobody Sun Feb 8 04:12:33 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=fail(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1689345521; cv=none; d=zohomail.com; s=zohoarc; b=aXSoycjfTGEO3SRvU3HIF3AvCUHoxaMEFEBdozQE7bmJWw8bOC7uEK07qUW9AyM0iRgQ+89EmvwP4WLSb2WRxbMcZUVO1TL32gxecWxS1sfldFjNigPnagjY5yK5YZZmdnDlM7OnbFwgG/02clUTgfVR7/oIIwflEfOA6U5+Yh4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689345521; 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=kZ9MashWUSNl/tolMPYF8JnK6FT547NLwqqQx/ipb+4=; b=LvGfYCgWY2hk14S6wzb9qxxDLqo0zITQkMzn4fvcZgcFK/QVr9JzfWKEF8IxCbWESWoaz3xy8A8YlmivIRnE/D7tLvosXDzp0gnEcSTitVU7rZQHkO5phzD+onBG9NLKAOXQvRTEV04MEcprsYA+qy079M/pOrHwECdgwwhtOA4= 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=fail header.from= (p=reject 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 168934552132388.75017367354337; Fri, 14 Jul 2023 07:38:41 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [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-101-JXSF5-ueNHKmFWPh8FPiAA-1; Fri, 14 Jul 2023 10:38:36 -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 4011E3C11C7E; Fri, 14 Jul 2023 14:38:34 +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 466E0200A7CA; Fri, 14 Jul 2023 14:38:31 +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 182011946594; Fri, 14 Jul 2023 14:38:29 +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 4CCD8194658F for ; Fri, 14 Jul 2023 14:38:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 20B2B40C206F; Fri, 14 Jul 2023 14:38:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 184A340C2063 for ; Fri, 14 Jul 2023 14:38:28 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 EF1628631DB for ; Fri, 14 Jul 2023 14:38:27 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-111-oLu5VfAqMPWH4_I7EIjDsg-1; Fri, 14 Jul 2023 10:38:23 -0400 Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36EEaSAs028315; Fri, 14 Jul 2023 14:38:22 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ru8048hyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 14:38:22 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36E7L2if020208; Fri, 14 Jul 2023 14:38:19 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3rtpwc8ayc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 14:38:19 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36EEcFIA16974528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jul 2023 14:38:15 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3089420043; Fri, 14 Jul 2023 14:38:15 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A0B020040; Fri, 14 Jul 2023 14:38:15 +0000 (GMT) Received: from fiuczyvm.. (unknown [9.171.221.174]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 14 Jul 2023 14:38:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689345520; 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=kZ9MashWUSNl/tolMPYF8JnK6FT547NLwqqQx/ipb+4=; b=IJ951fU4VSg2of2FaXc2ywQ5cCr1gg/xt4rUABGO5gveEn1Q/6uyg6SBoRwyPS7QCUyR91 26r08bjoIAjCVz9y4f7WUC5vb3kwYKipZz0bLCArwjN2RwdIyZrLIcXn4Yz4EE3kS41Wnr CU0n3yyXdyCqT8Nw9WrOCXhP9TSSCqA= X-MC-Unique: JXSF5-ueNHKmFWPh8FPiAA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: oLu5VfAqMPWH4_I7EIjDsg-1 From: Boris Fiuczynski To: libvir-list@redhat.com, walling@linux.ibm.com Subject: [PATCH] qemu: S390 does not provide physical address size Date: Fri, 14 Jul 2023 16:38:14 +0200 Message-Id: <20230714143814.68383-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: WYUaB1fQBiB7pxW1r2R9gpp84V-XWHde X-Proofpoint-GUID: WYUaB1fQBiB7pxW1r2R9gpp84V-XWHde X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-14_06,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=862 spamscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 mlxscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307140132 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 3.1 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: borntraeger@de.ibm.com, jdenemar@redhat.com, mhartmay@linux.ibm.com 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: linux.ibm.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1689345523177100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Commit be1b7d5b18 introduced parsing /proc/cpuinfo for "address size" which is not including on S390 and therefore reports an internal error. Lets remove the parsing on S390. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: Collin Walling Reviewed-by: Michal Privoznik --- src/cpu/cpu_x86.c | 2 +- src/qemu/qemu_capabilities.c | 2 +- src/util/virhostcpu.c | 11 +++++++++-- src/util/virhostcpu.h | 3 ++- tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 - tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 - tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 - tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 - tests/domaincapsmock.c | 7 +++++-- 9 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 8d371d5501..3c0163c4d1 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2795,7 +2795,7 @@ virCPUx86GetHost(virCPUDef *cpu, VIR_DEBUG("Host CPU does not support invariant TSC"); } =20 - if (virHostCPUGetPhysAddrSize(&addrsz) =3D=3D 0) { + if (virHostCPUGetPhysAddrSize(cpuData->arch, &addrsz) =3D=3D 0) { virCPUMaxPhysAddrDef *addr =3D g_new0(virCPUMaxPhysAddrDef, 1); =20 addr->bits =3D addrsz; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c9f4b17208..d82fe88057 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3911,7 +3911,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, } =20 if (virQEMUCapsTypeIsAccelerated(type)) - virHostCPUGetPhysAddrSize(&physAddrSize); + virHostCPUGetPhysAddrSize(hostArch, &physAddrSize); =20 virQEMUCapsSetHostModel(qemuCaps, type, physAddrSize, cpu, migCPU, ful= lCPU); =20 diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 19195a1470..41be4bffe0 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -1646,10 +1646,16 @@ virHostCPUGetSignature(char **signature) } =20 int -virHostCPUGetPhysAddrSize(unsigned int *size) +virHostCPUGetPhysAddrSize(const virArch hostArch, unsigned int *size) { g_autoptr(FILE) cpuinfo =3D NULL; =20 + if (ARCH_IS_S390(hostArch)) { + /* Ensure size is set to 0 as physical address size is unknown */ + *size =3D 0; + return 0; + } + if (!(cpuinfo =3D fopen(CPUINFO_PATH, "r"))) { virReportSystemError(errno, _("Failed to open cpuinfo file '%1$s'"= ), CPUINFO_PATH); @@ -1669,7 +1675,8 @@ virHostCPUGetSignature(char **signature) } =20 int -virHostCPUGetPhysAddrSize(unsigned int *size G_GNUC_UNUSED) +virHostCPUGetPhysAddrSize(const virArch hostArch G_GNUC_UNUSED, + unsigned int *size G_GNUC_UNUSED) { errno =3D ENOSYS; return -1; diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h index 5232fee36d..5f0d43e069 100644 --- a/src/util/virhostcpu.h +++ b/src/util/virhostcpu.h @@ -87,7 +87,8 @@ virHostCPUTscInfo *virHostCPUGetTscInfo(void); =20 int virHostCPUGetSignature(char **signature); =20 -int virHostCPUGetPhysAddrSize(unsigned int *size); +int virHostCPUGetPhysAddrSize(const virArch hostArch, + unsigned int *size); =20 int virHostCPUGetHaltPollTime(pid_t pid, unsigned long long *haltPollSuccess, diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_4.2.0.s390x.xml index c35bed1326..81395f43bf 100644 --- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml @@ -38,7 +38,6 @@ gen15a-base - diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_5.2.0.s390x.xml index 9dbf118713..1e615dab7c 100644 --- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml @@ -38,7 +38,6 @@ gen15a-base - diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsda= ta/qemu_6.0.0.s390x.xml index f0a8b196f5..f3287347aa 100644 --- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml @@ -38,7 +38,6 @@ gen15a-base - diff --git a/tests/domaincapsdata/qemu_8.1.0.s390x.xml b/tests/domaincapsda= ta/qemu_8.1.0.s390x.xml index 6b78a718b0..7380edd0c4 100644 --- a/tests/domaincapsdata/qemu_8.1.0.s390x.xml +++ b/tests/domaincapsdata/qemu_8.1.0.s390x.xml @@ -38,7 +38,6 @@ gen16a-base - diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c index cecb333602..6a23f2cb11 100644 --- a/tests/domaincapsmock.c +++ b/tests/domaincapsmock.c @@ -37,9 +37,12 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UN= USED) } =20 int -virHostCPUGetPhysAddrSize(unsigned int *size) +virHostCPUGetPhysAddrSize(const virArch hostArch, unsigned int *size) { - *size =3D 64; + if (ARCH_IS_S390(hostArch)) + *size =3D 0; + else + *size =3D 64; return 0; } =20 --=20 2.41.0