From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0EA01740038 for ; Tue, 26 Sep 2023 17:15:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=QVg2ZSOAn/5JwfKL4JAXjah/IiHb6a8nt51NTbn9cRE=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1695748545; v=1; b=tTStl8nLfLdg+XKesppxWlFVR/idWKNFWB+uGS1RrmRJ+LO4U/o6pKb1cgQ8N5HqIiDFk2sh Pv6dUhO1PhcYZxlyAd/YtHPbLblJj8y0bTVKFXVAavPlL7rJ84M1vvZk9U3/Bk7o68N1SDlT6KL jsd7Qq4q5l+k2EcDdA51lIJ4= X-Received: by 127.0.0.2 with SMTP id r4wxYY7687511xYSuYnFZHvv; Tue, 26 Sep 2023 10:15:45 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web11.25106.1695748544731687192 for ; Tue, 26 Sep 2023 10:15:44 -0700 X-Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38QD4hTJ019478; Tue, 26 Sep 2023 17:15:41 GMT X-Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tbw9bh6k3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:41 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38QHFf7m023114 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:41 GMT X-Received: from qc-i7.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 26 Sep 2023 10:15:39 -0700 From: "Leif Lindholm" To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v2 5/5] MdePkg/BaseLib: ensure ARM LongJump never returns 0 Date: Tue, 26 Sep 2023 18:15:23 +0100 Message-ID: <20230926171523.368706-6-quic_llindhol@quicinc.com> In-Reply-To: <20230926171523.368706-1-quic_llindhol@quicinc.com> References: <20230926171523.368706-1-quic_llindhol@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: CupVlEUr97SRH-HXCdS3S7oLakVmmsn5 X-Proofpoint-ORIG-GUID: CupVlEUr97SRH-HXCdS3S7oLakVmmsn5 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: haFKx3HsTOrnDhPas3w4pCpgx7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=tTStl8nL; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The ARM implementation of of InternalLongJump always returned the value Value - but it is not supposed to ever return 0. Add the test to prevent that, and return 1 if Value is 0 - as is already present in AArch64. Signed-off-by: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar --- MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S | 2 ++ MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S index e91320252255..14006c6123e3 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S @@ -57,6 +57,8 @@ ASM_PFX(SetJump): ASM_PFX(InternalLongJump): ldmia r0, {r3-r12,r14} mov r13, r3 + cmp r1, #0 + moveq r1, #1 mov r0, r1 bx lr diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm index ef02d85e0e66..15eb3dc28fb7 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm @@ -57,6 +57,8 @@ SetJump InternalLongJump LDM R0, {R3-R12,R14} MOV R13, R3 + CMP R1, #0 + MOVEQ R1, #1 MOV R0, R1 BX LR -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109079): https://edk2.groups.io/g/devel/message/109079 Mute This Topic: https://groups.io/mt/101600811/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-