Skip to content

Commit

Permalink
x86/boot: Use trampoline_phys variable directly from C code
Browse files Browse the repository at this point in the history
No more need to pass from assembly code.

Signed-off-by: Frediano Ziglio <[email protected]>
Reviewed-by: Andrew Cooper <[email protected]>
  • Loading branch information
freddy77 authored and andyhhp committed Oct 29, 2024
1 parent d5a73cd commit 56bd769
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 1 addition & 5 deletions xen/arch/x86/boot/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,9 @@ trampoline_setup:
mov %esi, sym_esi(xen_phys_start)
mov %esi, sym_esi(trampoline_xen_phys_start)

/* Get bottom-most low-memory stack address. */
mov sym_esi(trampoline_phys), %ecx
add $TRAMPOLINE_SPACE,%ecx

/* Save Multiboot / PVH info struct (after relocation) for later use. */
mov %ebx, %edx /* Multiboot / PVH information address. */
/* reloc(magic/eax, info/edx, trampoline/ecx) using fastcall. */
/* reloc(magic/eax, info/edx) using fastcall. */
call reloc

#ifdef CONFIG_PVH_GUEST
Expand Down
8 changes: 6 additions & 2 deletions xen/arch/x86/boot/reloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#include <xen/kconfig.h>
#include <xen/multiboot.h>
#include <xen/multiboot2.h>
#include <xen/page-size.h>

#include <asm/trampoline.h>

#include <public/arch-x86/hvm/start_info.h>

Expand Down Expand Up @@ -344,9 +347,10 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, memctx *ctx)
}

/* SAF-1-safe */
void *reloc(uint32_t magic, uint32_t in, uint32_t trampoline)
void *reloc(uint32_t magic, uint32_t in)
{
memctx ctx = { trampoline };
/* Get bottom-most low-memory stack address. */
memctx ctx = { trampoline_phys + TRAMPOLINE_SPACE };

switch ( magic )
{
Expand Down

0 comments on commit 56bd769

Please sign in to comment.