Jordan wrote:

>>> So, is it safe to adjust rbp? Unknown. It may not be if rbp is not
>>> used as a frame pointer. Is it safe to *not* adjust rbp and
>>> potentially allow the old temp ram stack to be used? Unknown.

Andrew wrote:

> Looks like OvmfPkg uses SetJump()/LongJump() to change the stack. 
> 
>   //
>   // Use SetJump()/LongJump() to switch to a new stack.
>   // 
>   if (SetJump (&JumpBuffer) == 0) {
> #if defined (MDE_CPU_IA32)
>     JumpBuffer.Esp = JumpBuffer.Esp + DebugAgentContext.StackMigrateOffset;
>     JumpBuffer.Ebp = JumpBuffer.Ebp + DebugAgentContext.StackMigrateOffset;
> #endif    
> #if defined (MDE_CPU_X64)
>     JumpBuffer.Rsp = JumpBuffer.Rsp + DebugAgentContext.StackMigrateOffset;
>     JumpBuffer.Rbp = JumpBuffer.Rbp + DebugAgentContext.StackMigrateOffset;
> #endif    
>     LongJump (&JumpBuffer, (UINTN)-1);
>   }
> 
>   SaveAndSetDebugTimerInterrupt (OldStatus);
> 
>   return EFI_SUCCESS;
> }
> 
> But given the above code is C code RBP is going to be restored on return. 
> This would seem to imply that the adjusting of the callers RBP is not 
> required? [...]

The Ebp/Rbp assignments were added in a separate bugfix, namely

  https://github.com/tianocore/edk2/commit/89796c69d9fd

Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to