From nobody Fri May 17 11:58:48 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=fail(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1696403166; cv=none; d=zohomail.com; s=zohoarc; b=TmqIA3HX9/dY3f6aoSrb7b9YArCtaGIX78/mnsZiZJ5IWia8oSfqI23TO8STTCeggsm9xo1ZmiK1DPlAbCD9S+vztk0GcCKSrO5pGphGVvj2YvMaEMYaQNMkL7+WZCWV1QdRtQ6B7iusUTdE4FKzrMLjbTuE6dhmdB1VW5cKF9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696403166; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=38YHi8zOSWG4fCdwE+H5cEnpd1l3HPxO9DDuHh9sydA=; b=EnUg0XM3NgHsU8Ur4w3dCj8upkRkHH5qWYFYU/hhlZ4VBZ8jim5rz4s20KRkJfgDNobnBUxbKZnGa0S1UKfCZQZQB8QkXRiCLl1VGjoAtmedg3+tgIcXZ0pA2sK74D1zYIrQDZt/sC7a1YJZkg3o1Z8Pv36h8FHcbYdETd7/5eI= 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=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.133.124]) by mx.zohomail.com with SMTPS id 169640316601678.29760521801677; Wed, 4 Oct 2023 00:06:06 -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-62-xOTbpLOgNA2MK5d_9CsX4g-1; Wed, 04 Oct 2023 03:06:00 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 A14FE811E7B; Wed, 4 Oct 2023 07:05:57 +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 A9A371054FC2; Wed, 4 Oct 2023 07:05:55 +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 30CED194658F; Wed, 4 Oct 2023 07:05:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 68961194658D for ; Wed, 4 Oct 2023 07:01:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F07FD492B16; Wed, 4 Oct 2023 07:01:03 +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 E84374026FC for ; Wed, 4 Oct 2023 07:01:03 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 5C6D71C05146 for ; Wed, 4 Oct 2023 07:01:03 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-18-FJ3UPfINPeGlUcUZSQgP1A-1; Wed, 04 Oct 2023 01:58:55 -0400 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3945tKSU002926 for ; Wed, 4 Oct 2023 05:58:54 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3th0w0smnp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Oct 2023 05:58:54 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39440udM006692 for ; Wed, 4 Oct 2023 05:58:53 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tf07k0bn8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Oct 2023 05:58:53 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3945wo2R60948802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Oct 2023 05:58:50 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66BB520043; Wed, 4 Oct 2023 05:58:50 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9EB7A2004D; Wed, 4 Oct 2023 05:58:49 +0000 (GMT) Received: from ltc-wspoon17.aus.stglabs.ibm.com (unknown [9.3.101.49]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 4 Oct 2023 05:58:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696403165; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=38YHi8zOSWG4fCdwE+H5cEnpd1l3HPxO9DDuHh9sydA=; b=dRSD6fLi4l5mSRHiFoCN040T9CJSWrCas4AtwvidsIyleMoHKF4xI39iOikpxQIEuC7nr0 eaC3Cll4k28y7TCnhndtDvu+pZDYTPRQWzquQTCV+UXNaWKsa6UcQdy+K1uI5AsXni4Ep6 hXE4UXkIznbFxDNR8zfD3AxTffJKt7Y= X-MC-Unique: xOTbpLOgNA2MK5d_9CsX4g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: FJ3UPfINPeGlUcUZSQgP1A-1 From: Narayana Murty N To: libvir-list@redhat.com, sbhat@linux.ibm.com, vaibhav@linux.ibm.com Subject: [PATCH] util:hostcpu: Report physical address size based on Architecture Date: Wed, 4 Oct 2023 01:58:41 -0400 Message-Id: <20231004055841.320816-1-nnmlinux@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: jnr3xPuER4Jg3j3QpwFj-pAHzCZ2DA1A X-Proofpoint-ORIG-GUID: jnr3xPuER4Jg3j3QpwFj-pAHzCZ2DA1A X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 mlxscore=0 impostorscore=0 phishscore=0 priorityscore=1501 mlxlogscore=776 clxscore=1011 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040039 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.9 X-Mailman-Approved-At: Wed, 04 Oct 2023 07:05:54 +0000 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.3 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: 1696403167549100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The function virHostCPUGetPhysAddrSize was introduced with commit be1b7d5b1= 8e fails on architectures other than x86 and SuperH. The commit 8417c1394cd4d fixed the issue only for s390 but the problem is still seen on other architectures like ppc which does not report Physical address size in their cpuinfo output. command: systemctl restart libvirtd.service Output : dnsmasq[2377]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses dnsmasq-dhcp[2377]: read /var/lib/libvirt/dnsmasq/default.hostsfile libvirtd[3163]: libvirt version: 9.8.0 libvirtd[3163]: hostname: xxxxxxxxxx libvirtd[3163]: internal error: Missing or invalid CPU address size in /proc/cpuinfo libvirtd.service: Deactivated successfully. This patch fixes this issue by returning the size=3D0 for architectures other than x86 and SuperH. Signed-off-by: Narayana Murty N Reviewed-by: Michal Privoznik --- src/util/virarch.h | 3 +++ src/util/virhostcpu.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virarch.h b/src/util/virarch.h index 81b1b27a57..747f77c48e 100644 --- a/src/util/virarch.h +++ b/src/util/virarch.h @@ -103,6 +103,9 @@ typedef enum { #define ARCH_IS_MIPS64(arch) ((arch) =3D=3D VIR_ARCH_MIPS64 ||\ (arch) =3D=3D VIR_ARCH_MIPS64EL) =20 +#define ARCH_IS_SH4(arch) ((arch) =3D=3D VIR_ARCH_SH4 ||\ + (arch) =3D=3D VIR_ARCH_SH4EB) + typedef enum { VIR_ARCH_LITTLE_ENDIAN, VIR_ARCH_BIG_ENDIAN, diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 0389012ef7..4027547e1e 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -1650,7 +1650,7 @@ virHostCPUGetPhysAddrSize(const virArch hostArch, { g_autoptr(FILE) cpuinfo =3D NULL; =20 - if (ARCH_IS_S390(hostArch)) { + if (!(ARCH_IS_X86(hostArch) || ARCH_IS_SH4(hostArch))) { /* Ensure size is set to 0 as physical address size is unknown */ *size =3D 0; return 0; --=20 2.39.2