mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 08:50:27 +00:00
HV: Make AP trampoline code relocatable
V3->V4: Updated function/variable names for accurancy V2->V3: Changed a few function/variable names to make it less confusing V1->V2: removed the unneccesary cache flushing - For UEFI boot, allocate memory for trampoline code in ACRN EFI, and pass the pointer to HV through efi_ctx - For other boot, scan E820 to allocate memory in HV run time - update_trampoline_code_refs() updates all the references that need the absolute PA with the actual load address Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Eddie Dong <eddie.dong> Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
@@ -157,11 +157,17 @@ int cpu_find_logical_id(uint32_t lapic_id);
|
||||
/**********************************/
|
||||
extern const uint8_t _ld_cpu_secondary_reset_load[];
|
||||
extern uint8_t _ld_cpu_secondary_reset_start[];
|
||||
extern uint8_t _ld_cpu_secondary_reset_end[];
|
||||
extern const uint64_t _ld_cpu_secondary_reset_size;
|
||||
extern uint8_t _ld_bss_start[];
|
||||
extern uint8_t _ld_bss_end[];
|
||||
extern uint8_t _ld_cpu_data_start[];
|
||||
extern uint8_t _ld_cpu_data_start[];
|
||||
extern uint8_t _ld_cpu_data_end[];
|
||||
extern uint8_t CPU_Boot_Page_Tables_Start[];
|
||||
extern uint8_t CPU_Boot_Page_Tables_ptr[];
|
||||
extern uint8_t cpu_secondary_pdpt_addr[];
|
||||
extern uint8_t cpu_secondary_gdt_ptr[];
|
||||
extern uint8_t ap_long_mode_jump_ref[];
|
||||
|
||||
extern int ibrs_type;
|
||||
|
||||
|
@@ -39,6 +39,7 @@ typedef struct {
|
||||
struct efi_ctx {
|
||||
uint64_t rip;
|
||||
void *rsdp;
|
||||
void *ap_trampoline_buf;
|
||||
dt_addr_t gdt;
|
||||
dt_addr_t idt;
|
||||
uint16_t tr_sel;
|
||||
@@ -74,5 +75,6 @@ struct efi_ctx {
|
||||
}__attribute__((packed));
|
||||
|
||||
void *get_rsdp_from_uefi(void);
|
||||
void *get_ap_trampoline_buf(void);
|
||||
|
||||
#endif /* UEFI_H*/
|
||||
|
Reference in New Issue
Block a user