From nobody Sat Sep 21 05:34:06 2024 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=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1684440695; cv=none; d=zohomail.com; s=zohoarc; b=SAfKv8ffByrP4BrE3DZ2zsmxVilhXGrCeepV8GXkCrEMVrlTpEoRkHvcmsK/1Wul6g4L2eDwYQRTfD1ewbsnrL0+ui/1+r4LwOt+UAM04711oQOQ7iny3/20sFx3z2/MhCjXx/H+bkDqVtxAWYBRzOxUdb9POWzsUhyRKjEStJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684440695; h=Content-Type: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=XO+PTLUuIKsfm+hUT+BJ5RaYUUS9yjRB7c7q5ZdIgec=; b=Hl6y5/eTtAEJ6hFgNRwipF4Gyn0vy+n1cgIZIi7HZvs2wEY0qX+FoNUWy1Y/3ZhNHq5uN6y/ScwFw+lnHjzFBrZu+vd9hJkoDtGrhL8pFfP5YdRKkeL5rJBJzbvi4p2zFnbM5lpvN9l6D4uzN8kr/vx4evYB9vvxw8aTgxlmeXg= 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 1684440695685979.2767260924638; Thu, 18 May 2023 13:11:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzjrs-0000Xs-H2; Thu, 18 May 2023 16:04:56 -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 1pzjrd-00009R-TT for qemu-devel@nongnu.org; Thu, 18 May 2023 16:04:44 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzjrR-00057B-5D for qemu-devel@nongnu.org; Thu, 18 May 2023 16:04:40 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34IJekx6023139; Thu, 18 May 2023 20:04:17 GMT Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qmxyp3sa2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 20:04:17 +0000 Received: from pps.filterd (NALASPPMTA04.qualcomm.com [127.0.0.1]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 34IK4GSO013707; Thu, 18 May 2023 20:04:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA04.qualcomm.com (PPS) with ESMTPS id 3qmrx7jyxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 20:04:16 +0000 Received: from NALASPPMTA04.qualcomm.com (NALASPPMTA04.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34IK4FFb013688; Thu, 18 May 2023 20:04:16 GMT Received: from hu-devc-sd-u20-a-1.qualcomm.com (hu-tsimpson-lv.qualcomm.com [10.47.204.221]) by NALASPPMTA04.qualcomm.com (PPS) with ESMTPS id 34IK4FUG013649 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 20:04:15 +0000 Received: by hu-devc-sd-u20-a-1.qualcomm.com (Postfix, from userid 47164) id AD8FD6E4; Thu, 18 May 2023 13:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=XO+PTLUuIKsfm+hUT+BJ5RaYUUS9yjRB7c7q5ZdIgec=; b=FqH0G54CyliEMPsVvUQO5xDp6qgbZPA2tbHblFphHmcKS4U8X9r+zmPQrmBclAnb6bc1 qQ292MMX7zfnBVPIx3q1hznSFTIw8VjBegNQ06sHeVM2aAJTThzdYgsP852JH32lbUcL E53HeLEhOSmaSG3+g2td36ZUht26tVKuzIqt4Avi7JtVI1xIzgOMj7jfIk0TkhE0kAQk yvubF4UqiOQWBpOR5JYAkzY+jTRAZ5ovnhF7ld8MTqwccSQ4iXuvqCSjcr8w527KJH4t ws6KXQIcSnA0PIpduAKH4SIJTjwzvdFD2buE78GYM4o+u0QN/FtuWi0/iIBFRpPTCXDx 9w== From: Taylor Simpson To: qemu-devel@nongnu.org Cc: tsimpson@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, peter.maydell@linaro.org, bcain@quicinc.com, quic_mathbern@quicinc.com, stefanha@redhat.com, ale@rev.ng, anjo@rev.ng, quic_mliebel@quicinc.com Subject: [PULL v2 35/44] Hexagon: append eflags to unknown cpu model string Date: Thu, 18 May 2023 13:04:02 -0700 Message-Id: <20230518200411.271148-36-tsimpson@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230518200411.271148-1-tsimpson@quicinc.com> References: <20230518200411.271148-1-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: LQXTOaEq69tH1-4wvoE8BJSJ4exHu_Id X-Proofpoint-GUID: LQXTOaEq69tH1-4wvoE8BJSJ4exHu_Id X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_14,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=470 priorityscore=1501 impostorscore=0 suspectscore=0 mlxscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180165 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=205.220.180.131; envelope-from=tsimpson@qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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 @quicinc.com) X-ZM-MESSAGEID: 1684440695925100001 From: Matheus Tavares Bernardino Running qemu-hexagon with a binary that was compiled for an arch version unknown by qemu can produce a somewhat confusing message: qemu-hexagon: unable to find CPU model 'unknown' Let's give a bit more info by appending the eflags so that the message becomes: qemu-hexagon: unable to find CPU model 'unknown (0x69)' Signed-off-by: Matheus Tavares Bernardino Signed-off-by: Taylor Simpson Tested-by: Taylor Simpson Reviewed-by: Taylor Simpson Message-Id: <8a8d013cc619b94fd4fb577ae6a8df26cedb972b.1683225804.git.quic_m= athbern@quicinc.com> --- linux-user/hexagon/target_elf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux-user/hexagon/target_elf.h b/linux-user/hexagon/target_el= f.h index a0271a0a2a..36056fc9f0 100644 --- a/linux-user/hexagon/target_elf.h +++ b/linux-user/hexagon/target_elf.h @@ -20,6 +20,9 @@ =20 static inline const char *cpu_get_model(uint32_t eflags) { + static char buf[32]; + int err; + /* For now, treat anything newer than v5 as a v73 */ /* FIXME - Disable instructions that are newer than the specified arch= */ if (eflags =3D=3D 0x04 || /* v5 */ @@ -39,7 +42,9 @@ static inline const char *cpu_get_model(uint32_t eflags) ) { return "v73"; } - return "unknown"; + + err =3D snprintf(buf, sizeof(buf), "unknown (0x%x)", eflags); + return err >=3D 0 && err < sizeof(buf) ? buf : "unknown"; } =20 #endif --=20 2.25.1