xen/arch/x86/acpi/power.c | 9 ++++++--- xen/arch/x86/boot/trampoline.S | 5 ++--- xen/arch/x86/boot/wakeup.S | 10 +++++----- xen/arch/x86/include/asm/trampoline.h | 4 ++-- xen/arch/x86/smpboot.c | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-)
... 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>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
xen/arch/x86/acpi/power.c | 9 ++++++---
xen/arch/x86/boot/trampoline.S | 5 ++---
xen/arch/x86/boot/wakeup.S | 10 +++++-----
xen/arch/x86/include/asm/trampoline.h | 4 ++--
xen/arch/x86/smpboot.c | 2 +-
5 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 08a7fc250800..e1b5c2827fc0 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -168,6 +168,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;
@@ -180,10 +181,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);
}
@@ -445,7 +448,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 )
{
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 924bda37c1b7..a92e399fbe0e 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -42,10 +42,9 @@
* 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)
diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S
index bbf9aa6040fa..654e97005ff4 100644
--- a/xen/arch/x86/boot/wakeup.S
+++ b/xen/arch/x86/boot/wakeup.S
@@ -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
diff --git a/xen/arch/x86/include/asm/trampoline.h b/xen/arch/x86/include/asm/trampoline.h
index 0c508d0222d0..dc536efe1f3d 100644
--- a/xen/arch/x86/include/asm/trampoline.h
+++ b/xen/arch/x86/include/asm/trampoline.h
@@ -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
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 891a29fca146..65a0c6b5d05b 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -571,7 +571,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 )
base-commit: e95dc03717b8ae00de2a0b41b88905af6170b210
--
2.39.5
On 03.03.2025 23:43, Andrew Cooper wrote: > ... 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>
© 2016 - 2025 Red Hat, Inc.