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 <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
---
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/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Hi Leif, Thank you for this patch. This patch looks good to me. Just a question, should we also do the same for the AArch32 builds? In either case, Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Regards, Sami Mujawar On 26/09/2023 06:15 pm, Leif Lindholm wrote: > 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 <quic_llindhol@quicinc.com> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> > Cc: Sami Mujawar <sami.mujawar@arm.com> > --- > 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] -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109201): https://edk2.groups.io/g/devel/message/109201 Mute This Topic: https://groups.io/mt/101600803/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
On Fri, Sep 29, 2023 at 16:06:54 +0100, Sami Mujawar wrote: > Hi Leif, > > Thank you for this patch. > > This patch looks good to me. > > Just a question, should we also do the same for the AArch32 builds? Hmm, fair point. But I just managed to get rid of this set after nearly 4 years :):) > In either case, > > Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Thanks! Commit message typo in 5/5 fixed and series merged as f6a314e5b5dc..1a66bd51ca21. Regards, Leif > Regards, > > Sami Mujawar > > On 26/09/2023 06:15 pm, Leif Lindholm wrote: > > 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 <quic_llindhol@quicinc.com> > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> > > Cc: Sami Mujawar <sami.mujawar@arm.com> > > --- > > 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] -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109256): https://edk2.groups.io/g/devel/message/109256 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] -=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.