[PATCH v4 18/45] x86: Improve the trampoline in 64-bit mode

Bin Meng bmeng.cn at gmail.com
Wed Jul 12 16:02:50 CEST 2023


On Mon, Jun 19, 2023 at 8:01 PM Simon Glass <sjg at chromium.org> wrote:
>
> At present this leaves the stack at the pre-relocation value. This is not
> ideal since we want to have U-Boot running entirely from the top of
> memory.
>
> In addition, the new global_data pointer is not actually used, since
> the global_data pointer itself is relocated, then the pre-relocation value
> is changed, so the effective value (after relocation) does not update.
>
> Adjust the implementation to follow the 32-bit code more closely, with a
> trampoline function which is passed the new stack and global_data pointer.
> This ensures that the correct values come through even when relocating.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> (no changes since v1)
>
>  arch/x86/cpu/start64.S            | 19 +++++++++++++++++++
>  arch/x86/include/asm/u-boot-x86.h | 11 +++++++++++
>  common/board_f.c                  | 12 +++++++-----
>  3 files changed, 37 insertions(+), 5 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list