diff --git a/hypervisor/arch/x86/pm.c b/hypervisor/arch/x86/pm.c index 775b03ed1..279cc7e6f 100644 --- a/hypervisor/arch/x86/pm.c +++ b/hypervisor/arch/x86/pm.c @@ -131,7 +131,7 @@ void host_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, u stac(); /* set ACRN wakeup vec instead */ - *(sstate_data->wake_vector_32) = (uint32_t)trampoline_start16_paddr; + *(sstate_data->wake_vector_32) = (uint32_t)get_trampoline_start16_paddr(); clac(); /* offline all APs */ diff --git a/hypervisor/arch/x86/trampoline.c b/hypervisor/arch/x86/trampoline.c index c827e73d2..944e7870e 100644 --- a/hypervisor/arch/x86/trampoline.c +++ b/hypervisor/arch/x86/trampoline.c @@ -9,7 +9,7 @@ #include #include -uint64_t trampoline_start16_paddr; +static uint64_t trampoline_start16_paddr; /* * Because trampoline code is relocated in different way, if HV code @@ -50,6 +50,11 @@ void write_trampoline_stack_sym(uint16_t pcpu_id) clflush(hva); } +uint64_t get_trampoline_start16_paddr(void) +{ + return trampoline_start16_paddr; +} + static void update_trampoline_code_refs(uint64_t dest_pa) { void *ptr; diff --git a/hypervisor/include/arch/x86/trampoline.h b/hypervisor/include/arch/x86/trampoline.h index cdc52ad3c..c210467fe 100644 --- a/hypervisor/include/arch/x86/trampoline.h +++ b/hypervisor/include/arch/x86/trampoline.h @@ -10,6 +10,7 @@ extern uint64_t read_trampoline_sym(const void *sym); extern void write_trampoline_sym(const void *sym, uint64_t val); extern void write_trampoline_stack_sym(uint16_t pcpu_id); extern uint64_t prepare_trampoline(void); +extern uint64_t get_trampoline_start16_paddr(void); /* external symbols that are helpful for relocation */ extern const uint8_t ld_trampoline_load; @@ -23,7 +24,4 @@ extern uint8_t cpu_boot_page_tables_ptr; extern uint8_t trampoline_pdpt_addr; extern uint8_t trampoline_gdt_ptr; extern uint8_t trampoline_start64_fixup; - -extern uint64_t trampoline_start16_paddr; - #endif /* TRAMPOLINE_H */