]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/trampoline: Rename entrypoints
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 25 Sep 2024 14:28:04 +0000 (15:28 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 7 Mar 2025 14:34:08 +0000 (14:34 +0000)
... to be more concise, and to match our other entrypoints into Xen.

In acpi_sleep_prepare(), calculate bootsym_phys() once, which GCC seems
unwilling to of it's own accord.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/power.c
xen/arch/x86/boot/trampoline.S
xen/arch/x86/boot/wakeup.S
xen/arch/x86/include/asm/trampoline.h
xen/arch/x86/smpboot.c

index d0b67614d521ddb8961598f99293b5639b8b4047..fe70257864e170140dd3c9d6d3eadef1d40eee18 100644 (file)
@@ -169,6 +169,7 @@ static void thaw_domains(void)
 static void acpi_sleep_prepare(u32 state)
 {
     void *wakeup_vector_va;
+    paddr_t entry_pa;
 
     if ( state != ACPI_STATE_S3 )
         return;
@@ -181,10 +182,12 @@ static void acpi_sleep_prepare(u32 state)
     wakeup_vector_va = fix_to_virt(FIX_ACPI_END) +
                        PAGE_OFFSET(acpi_sinfo.wakeup_vector);
 
+    entry_pa = bootsym_phys(entry_S3);
+
     if ( acpi_sinfo.vector_width == 32 )
-        *(uint32_t *)wakeup_vector_va = bootsym_phys(wakeup_start);
+        *(uint32_t *)wakeup_vector_va = entry_pa;
     else
-        *(uint64_t *)wakeup_vector_va = bootsym_phys(wakeup_start);
+        *(uint64_t *)wakeup_vector_va = entry_pa;
 
     clear_fixmap(FIX_ACPI_END);
 }
@@ -446,7 +449,7 @@ static void tboot_sleep(u8 sleep_state)
     g_tboot_shared->acpi_sinfo.wakeup_vector = acpi_sinfo.wakeup_vector;
     g_tboot_shared->acpi_sinfo.vector_width = acpi_sinfo.vector_width;
     g_tboot_shared->acpi_sinfo.kernel_s3_resume_vector =
-                                              bootsym_phys(wakeup_start);
+                                              bootsym_phys(entry_S3);
 
     switch ( sleep_state )
     {
index 924bda37c1b729e5da2512b294d5a1034cf49d4a..a92e399fbe0eb281f90e51483d45e9d6354e5d4c 100644 (file)
  * do_boot_cpu() programs the Startup-IPI to point here.  Due to the SIPI
  * format, the relocated entrypoint must be 4k aligned.
  *
- * It is entered in Real Mode, with %cs = trampoline_realmode_entry >> 4 and
- * %ip = 0.
+ * It is entered in Real Mode, with %cs = entry_SIPI16 >> 4 and %ip = 0.
  */
-GLOBAL(trampoline_realmode_entry)
+GLOBAL(entry_SIPI16)
         mov     %cs,%ax
         mov     %ax,%ds
         movb    $0xA5,bootsym(trampoline_cpu_started)
index bbf9aa6040faceed72950592d6b39e4ee2543b8b..654e97005ff429e6425f578183afb77012d12ddd 100644 (file)
@@ -7,18 +7,18 @@
         .equ    wakeup_stack, trampoline_start + PAGE_SIZE
         .local  wakeup_stack
 
-#define wakesym(sym) (sym - wakeup_start)
+#define wakesym(sym) (sym - entry_S3)
 
 /*
  * acpi_sleep_prepare() programs the S3 wakeup vector to point here.
  *
  * The ACPI spec says that we shall be entered in Real Mode with:
- *   %cs = wakeup_start >> 4
- *   %ip = wakeup_start & 0xf
+ *   %cs = entry_S3 >> 4
+ *   %ip = entry_S3 & 0xf
  *
- * As wakeup_start is 16-byte aligned, %ip is 0 in practice.
+ * As entry_S3 is 16-byte aligned, %ip is 0 in practice.
  */
-ENTRY(wakeup_start)
+ENTRY(entry_S3)
         cli
         cld
 
index 0c508d0222d0bc7ba436607e3966cfe146bb4bbf..dc536efe1f3d88506297984691f4b96c31cb33b0 100644 (file)
@@ -130,10 +130,10 @@ extern uint32_t trampoline_phys;
 #define bootsym(sym) (*((typeof(sym) *)__va(bootsym_phys(sym))))
 
 /* The INIT-SIPI-SIPI entrypoint.  16-bit code. */
-void nocall trampoline_realmode_entry(void);
+void nocall entry_SIPI16(void);
 
 /* The S3 wakeup vector.  16-bit code. */
-void nocall wakeup_start(void);
+void nocall entry_S3(void);
 
 /*
  * A variable in the trampoline, containing Xen's physical address.  Amongst
index 4e9f9ac4b2eec9546a504f6075ba9f51b1eebeb0..b63a9ce13e0a9f765f0603d9c9b9b7a3a9461b30 100644 (file)
@@ -572,7 +572,7 @@ static int do_boot_cpu(int apicid, int cpu)
 
     booting_cpu = cpu;
 
-    start_eip = bootsym_phys(trampoline_realmode_entry);
+    start_eip = bootsym_phys(entry_SIPI16);
 
     /* start_eip needs be page aligned, and below the 1M boundary. */
     if ( start_eip & ~0xff000 )