]> xenbits.xensource.com Git - xen.git/commitdiff
x86/boot: Use trampoline_phys variable directly from C code
authorFrediano Ziglio <frediano.ziglio@cloud.com>
Tue, 29 Oct 2024 10:29:41 +0000 (10:29 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Oct 2024 15:10:17 +0000 (15:10 +0000)
No more need to pass from assembly code.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/reloc.c

index 5da7ac138f3e6346906e9b1e057c04354d320e2d..dcda91cfda497632a1e571c8df77600c7f837317 100644 (file)
@@ -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
index 707d9c5f1529a4d25525e64f2edb2d4d247c161c..e50e161b27407690292153b8afb45e26809594cf 100644 (file)
@@ -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>
 
@@ -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 )
     {