From nobody Mon Feb 9 09:34:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1686031101; cv=none; d=zohomail.com; s=zohoarc; b=KLc0GFOSRD/DG0i17+ts/4Q1xJIBmM29MexbQUi8jyLTpHG+3rPA2ldPGOqpGFnPXfQZArdiIoxVZXVcRTtah1Qq8z3IcjFS1jr3byzfGqBHfTVPJOQYaPFKgL0uhvHAqmZsbPVPTWPemz0QCfIpUMSpDL9Tod/kkJo4ZBHWbVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686031101; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/4VWB/QIRuKBo2P+IdJiLWtR4YzapCXGmuLXjtj1eBc=; b=fs+ZhDk0vjFbNNUFAZSs6t8rhXgTdYFSHk8Itf910ndQkj9FqNgN09sUc7EYZr63R5/YOAcybIid4YSiUBb6puWWtKJPh9QwpY/5ffeCudT4h4zU8R6u/0jsvkoiyZ8vL2Vm0vYKx64EaPLSPk6c3zs+eMzTHL5eRnkX9aLL/CY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1686031101581437.3119283860109; Mon, 5 Jun 2023 22:58:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6Pgk-0004v6-5u; Tue, 06 Jun 2023 01:57:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6Pgi-0004ui-W3 for qemu-devel@nongnu.org; Tue, 06 Jun 2023 01:57:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6Pgh-0004D5-FU for qemu-devel@nongnu.org; Tue, 06 Jun 2023 01:57:00 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-458-q9sgLEW3N_a8AYByp_YOng-1; Tue, 06 Jun 2023 01:56:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D32453C025D8; Tue, 6 Jun 2023 05:56:50 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1CF92166B25; Tue, 6 Jun 2023 05:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686031018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/4VWB/QIRuKBo2P+IdJiLWtR4YzapCXGmuLXjtj1eBc=; b=R5qdofAJaDFsCDDso3ezXrtNEcmjWHbQ6RG/DcNZaiRXIwNOC1a2hmIg99XLf2WOrTNWiy MaFSs5e8TOJGPf1y0YZO3JEX8+2srbnoV+0dfcktQxnHGns5608j6GjXnbWsiE3IxCtQm5 1Mwuq7u589hnc1EjB3LpbtLzi6WiSEk= X-MC-Unique: q9sgLEW3N_a8AYByp_YOng-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Ilya Leoshkevich , David Hildenbrand Subject: [PULL 17/18] linux-user/elfload: Introduce elf_hwcap_str() on s390x Date: Tue, 6 Jun 2023 07:56:20 +0200 Message-Id: <20230606055621.523175-18-thuth@redhat.com> In-Reply-To: <20230606055621.523175-1-thuth@redhat.com> References: <20230606055621.523175-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1686031103552100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich It is required for implementing /proc/cpuinfo emulation. Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich Message-Id: <20230605113950.1169228-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- linux-user/loader.h | 1 + linux-user/elfload.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/linux-user/loader.h b/linux-user/loader.h index ad6ca9dbe3..59cbeacf24 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -58,6 +58,7 @@ extern unsigned long guest_stack_size; =20 #ifdef TARGET_S390X uint32_t get_elf_hwcap(void); +const char *elf_hwcap_str(uint32_t bit); #endif =20 #endif /* LINUX_USER_LOADER_H */ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 49ec9ccc94..d80d68484b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1605,6 +1605,33 @@ uint32_t get_elf_hwcap(void) return hwcap; } =20 +const char *elf_hwcap_str(uint32_t bit) +{ + static const char *hwcap_str[] =3D { + [HWCAP_S390_ESAN3] =3D "esan3", + [HWCAP_S390_ZARCH] =3D "zarch", + [HWCAP_S390_STFLE] =3D "stfle", + [HWCAP_S390_MSA] =3D "msa", + [HWCAP_S390_LDISP] =3D "ldisp", + [HWCAP_S390_EIMM] =3D "eimm", + [HWCAP_S390_DFP] =3D "dfp", + [HWCAP_S390_HPAGE] =3D "edat", + [HWCAP_S390_ETF3EH] =3D "etf3eh", + [HWCAP_S390_HIGH_GPRS] =3D "highgprs", + [HWCAP_S390_TE] =3D "te", + [HWCAP_S390_VXRS] =3D "vx", + [HWCAP_S390_VXRS_BCD] =3D "vxd", + [HWCAP_S390_VXRS_EXT] =3D "vxe", + [HWCAP_S390_GS] =3D "gs", + [HWCAP_S390_VXRS_EXT2] =3D "vxe2", + [HWCAP_S390_VXRS_PDE] =3D "vxp", + [HWCAP_S390_SORT] =3D "sort", + [HWCAP_S390_DFLT] =3D "dflt", + }; + + return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; +} + static inline void init_thread(struct target_pt_regs *regs, struct image_i= nfo *infop) { regs->psw.addr =3D infop->entry; --=20 2.31.1