Skip to content

Commit 2197f43

Browse files
jsun26intellijinxia
authored andcommitted
HV: Add acpi_fixup api to override acpi on needs
Add acpi_fixup() api in bsp that can override platform ACPI info when do init_bsp(), this is useful when platform bootloader is not lock down before production. In current code only the wake vector addresses would be parsed after boot and then override to host_acpi_info, we can add more in furture based on our needs. Tracked-On: #1264 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 0d5ad8a commit 2197f43

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

hypervisor/boot/acpi.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,19 @@ static void *get_facs_table(void)
364364
return facs_addr;
365365
}
366366

367+
/* put all ACPI fix up code here */
368+
void acpi_fixup(void)
369+
{
370+
uint8_t *facs_addr;
371+
372+
facs_addr = get_facs_table();
373+
374+
if (facs_addr != NULL) {
375+
host_acpi_info.pm_s_state.wake_vector_32 =
376+
(uint32_t *)(facs_addr + OFFSET_WAKE_VECTOR_32);
377+
host_acpi_info.pm_s_state.wake_vector_64 =
378+
(uint64_t *)(facs_addr + OFFSET_WAKE_VECTOR_64);
379+
}
380+
}
381+
367382
#endif

hypervisor/bsp/include/bsp_extern.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@ extern struct acpi_info host_acpi_info;
3636
/* BSP Interfaces */
3737
void init_bsp(void);
3838

39+
#ifndef CONFIG_CONSTANT_ACPI
40+
void acpi_fixup(void);
41+
#endif
42+
3943
#endif /* BSP_EXTERN_H */

hypervisor/bsp/sbl/sbl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,7 @@ struct dmar_info *get_dmar_info(void)
6262

6363
void init_bsp(void)
6464
{
65+
#ifndef CONFIG_CONSTANT_ACPI
66+
acpi_fixup();
67+
#endif
6568
}

hypervisor/bsp/uefi/uefi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ static void efi_init(void)
115115

116116
void init_bsp(void)
117117
{
118+
#ifndef CONFIG_CONSTANT_ACPI
119+
acpi_fixup();
120+
#endif
118121
parse_hv_cmdline();
119122

120123
#ifdef CONFIG_EFI_STUB

0 commit comments

Comments
 (0)