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 A5CA1AC1536 for ; Tue, 26 Sep 2023 17:15:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gWSJxskAoOUyiW4jALea1LWurCPgAjARj+WTKzO/FR8=; 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=SvOzsdPigbyysxU5mFbpABkndT02ustrFX5soVflQwt+AhZL38hiC+iXNoug64HSKuAPa7Lp 7588tpwM01EHVjYXjQRp8d1S5QFj8fBJxXkjEP2UMJk9qqcI/By6v4upn79zGU6rsq9O63BQ1Lh OeBG7xkc+/hIo9NTpUU49D8g= X-Received: by 127.0.0.2 with SMTP id 0hwXYY7687511xo1qtBEj85o; 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: Yozp52IPwtA496HqKIBAmerqx7686176AA= 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=SvOzsdPi; 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 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 --- 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/Library/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/Library/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] -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-