From nobody Tue Feb 10 13:16:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65813+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65813+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1601577443; cv=none; d=zohomail.com; s=zohoarc; b=ejRLeiM/y9fsgALHS7HISdIRsPX+7ou2LXF1g6/qP6dzGotXLPLuzKadSd7e4rOsbvN6rlotXZNRje81wEjakVTP/ZR765lj5hAvQUYJG3f8RqcsToRN6e2VBQVFvV9KAg6kPzhSy3b6fFX0WSg1ExMxa8vV9rbO1BdiRTYi060= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601577443; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=+qAps3Fnj0FHwiM+Hdyj7R+adWadUD/KsTNiH5irpQk=; b=m+WWVZFrFYmYwJh1IDeTIAT8TgAnCEwScxD2YmiSUba3NicMk7JAqpe+YcY52gn2isNyjIisjPu4cmxZ4XdvMx67EEh5rszhq95IA3sW8SJppRpVKc1Us/klgetYQoaKXEesU6utObd8eFG4ehWX9Lf56nN/pXnygbQzRHyrkjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65813+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1601577443739632.3603513689452; Thu, 1 Oct 2020 11:37:23 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id gfFvYY1788612xGHOlYXsq4c; Thu, 01 Oct 2020 11:37:23 -0700 X-Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.web10.1031.1601577442458089088 for ; Thu, 01 Oct 2020 11:37:22 -0700 X-Received: by mail-wm1-f49.google.com with SMTP id t17so4203483wmi.4 for ; Thu, 01 Oct 2020 11:37:22 -0700 (PDT) X-Gm-Message-State: jpIicOys5pW9l7SjsYjLq3Osx1787277AA= X-Google-Smtp-Source: ABdhPJzaHbcXboVpdqaBm6i2MlMzQ63pksW12yaujg/xeOs7J7jWlaY6CxKCiRvzUFnR4lUjRE+uTw== X-Received: by 2002:a1c:5602:: with SMTP id k2mr1372819wmb.25.1601577440638; Thu, 01 Oct 2020 11:37:20 -0700 (PDT) X-Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id a3sm964671wmb.46.2020.10.01.11.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 11:37:20 -0700 (PDT) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH 2/5] MdePkg/BaseLib: add ASSERT in ARM* SetJump implementations Date: Thu, 1 Oct 2020 19:37:09 +0100 Message-Id: <20201001183712.1738-3-leif@nuviainc.com> In-Reply-To: <20201001183712.1738-1-leif@nuviainc.com> References: <20201001183712.1738-1-leif@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1601577443; bh=PXWP2K7wdIUCx59B7xEkzbg6cMLWLs7O17qvFccBRc0=; h=Cc:Date:From:Reply-To:Subject:To; b=jtUoP1cBRFlHxRIKyFmZ/kmYvePAYXptDRM1it2+TVUhlmukOv7+lwI1FdQH64rAHIy p6OD8auwkSEBbBPxTwSwsAMWdJDHMDZcQe/8Z58+Ef7HcZ0kUrrHQvxehGEWRcTMkx20v h+l/5gVNgx/PDbItqXJVQ2fmITTdYjXTLTo= X-ZohoMail-DKIM: pass (identity @groups.io) 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 --- 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, 12 insertions(+) diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Libr= ary/BaseLib/AArch64/SetJumpLongJump.S index 989736cee74c..34765a676430 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -45,6 +45,9 @@ GCC_ASM_EXPORT(InternalLongJump) # ); # ASM_PFX(SetJump): + stp x30, x0, [sp, #-16]! + bl InternalAssertJumpBuffer + ldp x30, x0, [sp], #16 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 8922128e8c62..f2729a8bb03e 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -44,6 +44,9 @@ ; ); ; SetJump + stp x30, x0, [sp, #-16]! + bl InternalAssertJumpBuffer + ldp x30, x0, [sp], #16 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/Arm/SetJumpLongJump.S b/MdePkg/Library/= BaseLib/Arm/SetJumpLongJump.S index e4c1946a28ff..54b11ad2197c 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S @@ -31,6 +31,9 @@ GCC_ASM_EXPORT(InternalLongJump) # ); # ASM_PFX(SetJump): + push {r0, lr} + bl InternalAssertJumpBuffer + pop {r0, lr} mov r3, r13 stmia r0, {r3-r12,r14} eor r0, r0, r0 diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm b/MdePkg/Librar= y/BaseLib/Arm/SetJumpLongJump.asm index e1eff758f7ab..6d47033975f2 100644 --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm @@ -31,6 +31,9 @@ ; ) ; SetJump + PUSH {R0, LR} + BL InternalAssertJumpBuffer + POP {R0, LR} MOV R3, R13 STM R0, {R3-R12,R14} EOR R0, R0 --=20 2.20.1 -=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 (#65813): https://edk2.groups.io/g/devel/message/65813 Mute This Topic: https://groups.io/mt/77247140/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-