From nobody Tue Feb 10 12:59:18 2026 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-