From nobody Thu May 9 10:02:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109075+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109075+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695748539; cv=none; d=zohomail.com; s=zohoarc; b=PLJne3DiWUjLQTNca3orkQZQzFGYYBiZ/cx3VLNJkyyIKU5V7SpBosCSfYZzawX/SmgX0N0FvEZj/bBMWDjxKy1H5NiXVhOVncrDfD94ASEbQU8z3kPt4KY/F7W45xITxHr9k1nOcUN+to6AlNnTeu6c0hWZL0K3OBZUvFECyv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695748539; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=/oGqiZWKYDd6ipFlQqVOW1BdMJmuRLfHuQA2grBS530=; b=fRQRZLMjNpEXeRx/RwAsnwftvtguYBRIyWcklFXhkNyHhL+6cxcLBY7IDRftkyrfQrBBURMI1xJ50ZrqR8ijma9sI9jUdh6bjU6maca4WaBsGQuHIjEcr3WC7pB6ao/UDVzsNI/iDZAyHQKyICWaNsRBqvFZ3g/rPxoLEB4PlFM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109075+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169574853912240.419633401314854; Tue, 26 Sep 2023 10:15:39 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=DIq1Cbm1UqQPwo3Vsvdpg3QLsmMlRil8b3lEKHDcXUk=; 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=1695748538; v=1; b=v7DSS0WabDdQn4foHHuDNG17b4aEiDYW6t58HqZodWBC9S1X3WA6sl9YTPqr2OBqG0DkfQ3B S+GU9EmUtT4BnksCwwQjf2Kc1ve0grVX09CGETIzowmvh9KohpfjvZ0Tggj0nXz3K4ngyLEpnbo 0DnZGizvtGmZIHigxVb1wpsg= X-Received: by 127.0.0.2 with SMTP id Jzj9YY1788612xd0okmTT0eL; Tue, 26 Sep 2023 10:15:38 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.25332.1695748538272809230 for ; Tue, 26 Sep 2023 10:15:38 -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 38QF04uh009098; Tue, 26 Sep 2023 17:15:35 GMT X-Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tbw9bh6jr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:34 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38QHFYsP022502 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:34 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:32 -0700 From: "Leif Lindholm" To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v2 1/5] MdePkg/BaseLib: fix comments in ARM* SetJump/LongJump implementations Date: Tue, 26 Sep 2023 18:15:19 +0100 Message-ID: <20230926171523.368706-2-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: TLSx-lnGPO9xM9Tv_cx6HOmXqRSQQYwq X-Proofpoint-ORIG-GUID: TLSx-lnGPO9xM9Tv_cx6HOmXqRSQQYwq 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: RurokxgNxs4V3vSLWSdPS1I1x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695748541417100009 Content-Type: text/plain; charset="utf-8" Drop redundant comment about IPF (clearly copied across from now deleted code). Also change "Instead is resumes execution" -> "Instead it resumes execution" Signed-off-by: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Reviewed-by: Sami Mujawar --- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S | 3 +-- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 3 +-- MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S | 3 +-- MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Libr= ary/BaseLib/AArch64/SetJumpLongJump.S index 0d902d94d31c..78db9b3d1e78 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -33,7 +33,6 @@ GCC_ASM_EXPORT(InternalLongJump) # value to be returned by SetJump(). # # If JumpBuffer is NULL, then ASSERT(). -# For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then = ASSERT(). # # @param JumpBuffer A pointer to CPU context buffer. # @@ -62,7 +61,7 @@ ASM_PFX(SetJump): # # Restores the CPU context from the buffer specified by JumpBuffer. # This function never returns to the caller. -# Instead is resumes execution based on the state of JumpBuffer. +# Instead it resumes execution based on the state of JumpBuffer. # # @param JumpBuffer A pointer to CPU context buffer. # @param Value The value to return when the SetJump() context is= restored. diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/Li= brary/BaseLib/AArch64/SetJumpLongJump.asm index df70f298998e..d8b267addc1a 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -32,7 +32,6 @@ ; value to be returned by SetJump(). ; ; If JumpBuffer is NULL, then ASSERT(). -; For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then = ASSERT(). ; ; @param JumpBuffer A pointer to CPU context buffer. ; @@ -60,7 +59,7 @@ SetJump ; ; Restores the CPU context from the buffer specified by JumpBuffer. ; This function never returns to the caller. -; Instead is resumes execution based on the state of JumpBuffer. +; Instead it resumes execution based on the state of JumpBuffer. ; ; @param JumpBuffer A pointer to CPU context buffer. ; @param Value The value to return when the SetJump() context is= restored. diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S b/MdePkg/Library/= BaseLib/Arm/SetJumpLongJump.S index 82d94faf61e9..e4c1946a28ff 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S @@ -19,7 +19,6 @@ GCC_ASM_EXPORT(InternalLongJump) # value to be returned by SetJump(). # # If JumpBuffer is NULL, then ASSERT(). -# For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then = ASSERT(). # # @param JumpBuffer A pointer to CPU context buffer. # @@ -42,7 +41,7 @@ ASM_PFX(SetJump): # # Restores the CPU context from the buffer specified by JumpBuffer. # This function never returns to the caller. -# Instead is resumes execution based on the state of JumpBuffer. +# Instead it resumes execution based on the state of JumpBuffer. # # @param JumpBuffer A pointer to CPU context buffer. # @param Value The value to return when the SetJump() context is= restored. diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm b/MdePkg/Librar= y/BaseLib/Arm/SetJumpLongJump.asm index 936f722be60f..e1eff758f7ab 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm @@ -19,7 +19,6 @@ ; value to be returned by SetJump(). ; ; If JumpBuffer is NULL, then ASSERT(). -; For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then = ASSERT(). ; ; @param JumpBuffer A pointer to CPU context buffer. ; @@ -42,7 +41,7 @@ SetJump ; ; Restores the CPU context from the buffer specified by JumpBuffer. ; This function never returns to the caller. -; Instead is resumes execution based on the state of JumpBuffer. +; Instead it resumes execution based on the state of JumpBuffer. ; ; @param JumpBuffer A pointer to CPU context buffer. ; @param Value The value to return when the SetJump() context is= restored. --=20 2.30.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109075): https://edk2.groups.io/g/devel/message/109075 Mute This Topic: https://groups.io/mt/101600801/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 10:02:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109076+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109076+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695748540; cv=none; d=zohomail.com; s=zohoarc; b=V0JBMh1njdnSq4G756FG0JBELf8hUoZl0AvVsSBagrZMDxcr9ZYx+kF4DHD4mHkqVthoBfLm8rDDaWjGq9fst0CQk9/4EpVfQzEApReYEIMEf4wtsqst8zXtwH1EPks/rUT7eEriX1GrO9gb0+G3cWONj1ZHh9+34nWqYc9PZak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695748540; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=T58t6r/bMrRp4eWLuMsXLM/yowRL9Y9a4z6pKyOdEKU=; b=FhZHmHaQsnPGA1yll92/97NADgSJ/7e+rxv9Hmct1DUMYllZ50+lZIV4l/J1TsvjG0UipL3GEKk2xaJejFDvS6zJJwC9iOvZMSceolsCKIdAlZxjqORcyMOnpw8W4zW6wJGPRjTkeqMXsHql/sIrqPs9+Fcps/kgRcvtwKzDir0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109076+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695748540680979.8844440812078; Tue, 26 Sep 2023 10:15:40 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=v55V6yEO+ZUsM/1JPLVuJkjAFqpRjunSjxzxLCdMza0=; 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=1695748540; v=1; b=JrfhJksAe9klmDedeI33Aqrt4ih20S2VGKCLbHQhwxYjwFk1yxQZHUW3P0eN6gi9cjWXy/dV go5tweeGde66SbiZ+worwxYhZKh0bMSvThORi6GSCo7tIl3Bux3Jn19DvqZs13mi7gIAtoBHw2I nW8Eu8+v9/kzuzz3f6X7f6n8= X-Received: by 127.0.0.2 with SMTP id fOhGYY1788612xgo38I0oIIK; Tue, 26 Sep 2023 10:15:40 -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.25102.1695748539891620423 for ; Tue, 26 Sep 2023 10:15:39 -0700 X-Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38QD4iGZ032739; Tue, 26 Sep 2023 17:15:36 GMT X-Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tbv661buw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:36 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38QHFZdQ022523 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:35 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:34 -0700 From: "Leif Lindholm" To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v2 2/5] MdePkg/BaseLib: add ASSERT in ARM* SetJump implementations Date: Tue, 26 Sep 2023 18:15:20 +0100 Message-ID: <20230926171523.368706-3-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-ORIG-GUID: hSiiz1Ixg-OcHSW8V-Nw0KDvKwE0v3kO X-Proofpoint-GUID: hSiiz1Ixg-OcHSW8V-Nw0KDvKwE0v3kO 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: CS7U5q2fBlkqJTafOMEQ9bjix1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695748541568100011 Content-Type: text/plain; charset="utf-8" The SetJump comment header states that: If JumpBuffer is NULL, then ASSERT(). However, this was not currently done. Add a call to InternalAssertJumpBuffer. Signed-off-by: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Reviewed-by: Sami Mujawar --- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S | 8 ++++++++ MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Libr= ary/BaseLib/AArch64/SetJumpLongJump.S index 78db9b3d1e78..de79ad3a0a3e 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -46,6 +46,14 @@ GCC_ASM_EXPORT(InternalLongJump) # ASM_PFX(SetJump): AARCH64_BTI(c) +#ifndef MDEPKG_NDEBUG + stp x29, x30, [sp, #-32]! + mov x29, sp + str x0, [sp, #16] + bl InternalAssertJumpBuffer + ldr x0, [sp, #16] + ldp x29, x30, [sp], #32 +#endif mov x16, sp // use IP0 so save SP #define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS] #define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS] diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/Li= brary/BaseLib/AArch64/SetJumpLongJump.asm index d8b267addc1a..c2774eece311 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -44,6 +44,14 @@ ; ); ; SetJump +#ifndef MDEPKG_NDEBUG + stp x29, x30, [sp, #-32]! + mov x29, sp + str x0, [sp, #16] + bl InternalAssertJumpBuffer + ldr x0, [sp, #16] + ldp x29, x30, [sp], #32 +#endif mov x16, sp // use IP0 so save SP #define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS] #define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS] --=20 2.30.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109076): https://edk2.groups.io/g/devel/message/109076 Mute This Topic: https://groups.io/mt/101600803/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 10:02:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109078+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109078+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695748544; cv=none; d=zohomail.com; s=zohoarc; b=REs3Wk9IQwwCesrKwKw884wUZszivTNf2eoO3cowGJ3vLFICFOtPtP1zgcl1u6tSWEzon5HgDBAglVg0E6Wxr/6WbL3Hx+tH5RCuisDp1YVuRt7A/Y9SI8EFJXeIhCPBQjs0vg56CWun66Q1X+Q6d3tQ1HjgOsyB73bTK6gjFPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695748544; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=xzYEnWzosCm2e0sGGpIKB131jjh7EKL6xNGKDRnKRZo=; b=KUZ+S4bKYv+0z/e0YOzYBnThbc6F/y3fzGA3VTu01NacccW3LMBcMrZgcB7H700VTgjZ5pliovVhAmJ5rc/NxW0LLDIZIWVymYale9i9etSqfe1c6i6WOS7mVizFjGXA/vvBU91bOkOq/OZA5LgMF6bBS99ek/3PFzMLeCfI+F0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109078+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695748544396698.8220432714382; Tue, 26 Sep 2023 10:15:44 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=/1GHpFjVQY4htA8zOU6gZsKdAKgPh5zCtRUN70iuq0Y=; 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=1695748544; v=1; b=N6PFiCypK8eTTK/SGakZZf0h1J8SiKYsnzKTCK2++8AU2L0iJlTM7JqHbBq8luknbEhWDenL oyz05maukiDy+kQABhxD8uBuTYNSc0e2I0yffqpALcy6G7mynsmbVm8n5HRS/ihSP2ICUrrk1e7 p0JmXhMtObVFssSkJIOmHF2w= X-Received: by 127.0.0.2 with SMTP id gNQOYY1788612x08FqsxlGht; Tue, 26 Sep 2023 10:15:44 -0700 X-Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web10.25337.1695748543262128008 for ; Tue, 26 Sep 2023 10:15:43 -0700 X-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 38QD8Xli015088; Tue, 26 Sep 2023 17:15:38 GMT X-Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tb7re3w87-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:38 +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 38QHFbej023061 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:37 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:36 -0700 From: "Leif Lindholm" To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v2 3/5] MdePkg/BaseLib: use normal register init in ARM SetJump implementations Date: Tue, 26 Sep 2023 18:15:21 +0100 Message-ID: <20230926171523.368706-4-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-ORIG-GUID: rbMB12DCchw5Jf6OCv4wUKDsTEJA69_W X-Proofpoint-GUID: rbMB12DCchw5Jf6OCv4wUKDsTEJA69_W 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: NxMA3y6smnn0o7DDjWqHXTx9x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695748544703100002 Content-Type: text/plain; charset="utf-8" There may be architectures on which there are benefits to eor r0, r0(, r0) but ARM was never one of them. Change to more readable mov r0, #0 instead. Signed-off-by: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Reviewed-by: Sami Mujawar --- MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S | 2 +- MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S b/MdePkg/Library/= BaseLib/Arm/SetJumpLongJump.S index e4c1946a28ff..e91320252255 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S @@ -33,7 +33,7 @@ GCC_ASM_EXPORT(InternalLongJump) ASM_PFX(SetJump): mov r3, r13 stmia r0, {r3-r12,r14} - eor r0, r0, r0 + mov r0, #0 bx lr =20 #/** diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm b/MdePkg/Librar= y/BaseLib/Arm/SetJumpLongJump.asm index e1eff758f7ab..ef02d85e0e66 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm @@ -33,7 +33,7 @@ SetJump MOV R3, R13 STM R0, {R3-R12,R14} - EOR R0, R0 + MOV RO, #0 BX LR =20 ;/** --=20 2.30.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109078): https://edk2.groups.io/g/devel/message/109078 Mute This Topic: https://groups.io/mt/101600809/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 10:02:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109077+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109077+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695748543; cv=none; d=zohomail.com; s=zohoarc; b=AJZPD9PJQ6wBDOgx1oX2QKwu7orstDxc/X7A8MmG4hRZGQv734P+pnIM+LGwWXFtAvkjCgx6MFIq4OVcajQvbXpb5pzkImZ30BX2Os0TyVWp2ZR3xrOJgHxKVKBBygVXRBNLJLkQiuvxW5fgYfygOtEUO61PNepSHj7SeCQJhPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695748543; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=TYiQKf2NMfZZnvfvUsUrgXUAeRuQrarinAVNhWB2gZU=; b=gHwwD7SHvLNvuKjNqX24AWkcuHsk3Pdav5JnILdr/V9Sj7n2GZvYVo+I2ghJlAZwM3opK5qSNsbX1ul2f6OtwUy81N5ulYAvAst/I1EHTMja0N9YzQRAetAzh+2Yx4XoTiBNBynNxr0wxOBva0HOvcgew5/NMojxbZJgEoglPbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109077+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169574854383811.756393031962489; Tue, 26 Sep 2023 10:15:43 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=PNe4/7Lqh7nOce7nCfaHN5Z3Dp/AYtXohVJYRklwiaA=; 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=1695748543; v=1; b=sDaOAaM3I6X+fZw9a/EE6rdFS1VbScMxrN7SjUioWbF0AcAERkIGBzn6+iGmJRr4sYyN//3s kF6Zsd10lVH1nglaV4YdN/qH9KGj9o/uc5PnsTL5qDhulIAdzBdipUaHZS1sznK7qsUeIxIcwEj JPrG5eBwwyjgWmxfGm55q5qY= X-Received: by 127.0.0.2 with SMTP id KcVqYY1788612xgAsfpNPudf; Tue, 26 Sep 2023 10:15:43 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.25336.1695748542929930538 for ; Tue, 26 Sep 2023 10:15:42 -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 38QD4fZL019379; Tue, 26 Sep 2023 17:15:40 GMT X-Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tbw9bh6k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:39 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38QHFdlD002292 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:39 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:37 -0700 From: "Leif Lindholm" To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrei Warkentin , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v2 4/5] MdePkg/BaseLib: correct register sizes in AArch64 SetJump/LongJump Date: Tue, 26 Sep 2023 18:15:22 +0100 Message-ID: <20230926171523.368706-5-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: -1_tl99B9uxy_vBVXK2Wh-YPvE-Y8MSW X-Proofpoint-ORIG-GUID: -1_tl99B9uxy_vBVXK2Wh-YPvE-Y8MSW 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: irGXSvxdWcuel1SD5QKKC8Oyx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695748544915100005 Content-Type: text/plain; charset="utf-8" Both in SetJump and in InternalLongJump, 32-bit w register views were used for the UINTN return value. In SetJump, this did not cause errors; it was only counterintuitive. But in InternalLongJump, it meant the top 32 bits of Value were stripped off. Change all of these to use the 64-bit x register views. Signed-off-by: Leif Lindholm Reanimated-by: Andrei Warkentin Cc: Ard Biesheuvel Cc: Sami Mujawar Reviewed-by: Andrei Warkentin Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Sami Mujawar --- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S | 8 ++++---- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Libr= ary/BaseLib/AArch64/SetJumpLongJump.S index de79ad3a0a3e..3e58119b25d2 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -61,7 +61,7 @@ ASM_PFX(SetJump): FPR_LAYOUT #undef REG_PAIR #undef REG_ONE - mov w0, #0 + mov x0, #0 ret =20 #/** @@ -91,9 +91,9 @@ ASM_PFX(InternalLongJump): #undef REG_PAIR #undef REG_ONE mov sp, x16 - cmp w1, #0 - mov w0, #1 - csel w0, w1, w0, ne + cmp x1, #0 + mov x0, #1 + csel x0, x1, x0, ne ret =20 ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/Li= brary/BaseLib/AArch64/SetJumpLongJump.asm index c2774eece311..6ec8f35f2c9f 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -59,7 +59,7 @@ SetJump FPR_LAYOUT #undef REG_PAIR #undef REG_ONE - mov w0, #0 + mov x0, #0 ret =20 ;/** @@ -88,10 +88,10 @@ InternalLongJump #undef REG_PAIR #undef REG_ONE mov sp, x16 - cmp w1, #0 - mov w0, #1 + cmp x1, #0 + mov x0, #1 beq exit - mov w0, w1 + mov x0, x1 exit // use br not ret, as ret is guaranteed to mispredict br x30 --=20 2.30.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109077): https://edk2.groups.io/g/devel/message/109077 Mute This Topic: https://groups.io/mt/101600808/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 10:02:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109079+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109079+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695748545; cv=none; d=zohomail.com; s=zohoarc; b=JUZKxh4oRZfrTLgOsLFiq9TyN8ypTRhjh0lKt5O1ByhCtmwrID16h57XMSq+uMg+lHFvY7zoTu2EsWBcDSwXBCtnqa6Of6SzKS9rxbbv94RbS0v6tReWahg+Izz1nK6kAoxy/3ag3Y8FcE8YGhDi3iys924lYpLvrJ3VuGwk4/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695748545; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=+ddx0/f57PCXHXGw6DTz6ucSw41UwhHtpvzYhFnvJfM=; b=KRRtm1999RKLwm/yTFX5xkbrDWwk36vUIwn+me2fYL8tq3vc2et7+lSQJ0fK+L6f8/0zs7ffnHqvssdjdvR2oL03c6hXQhoecXgfmS++0KFYHJD+NQ4k85HzQ2FQW7VNMkv2NVE/Z7/dbvQk/ymKQaNUHtbN0hfbFkNto/LsvGM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109079+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695748545511394.6431645610554; Tue, 26 Sep 2023 10:15:45 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=iqe+GjSscpotPKTLrGMZL91ZZL+xOy86ntYoPIEkC48=; 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=BixgvaGcCDxnLbgK9ezW44K1018/RRnthOaGd+KBX+XWGueATS4HmCHaVhi7SrGWRE2uSn9M 9vGjnOyU4nrvzvTPi0DdU4tfy9pEU1SJ9YWVX4o7uZzRIjibGyuZ/7E4FA//4ww4WChRhHJ1J5u 4R+Z7rQJe56B2xFYXkwGs7dA= X-Received: by 127.0.0.2 with SMTP id DfDdYY1788612xPbp5npOjY3; 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: JirnJLizurJ4nXeypruDRAgNx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695748546986100009 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: 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 =20 diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm b/MdePkg/Librar= y/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 =20 --=20 2.30.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-