HV: split sanitize_multiboot_info api

Previously sanitize_multiboot_info() was called after init_debug_pre() because
the debug message can only print after uart is initialized. On the other hand,
multiboot cmdline need to be parsed before init_debug_pre() because the cmdline
could override uart settings and make sure debug message printed successfully.
This cause multiboot info was parsed in two stages.

The patch revise the multiboot parse logic that split sanitize_multiboot_info()
api and use init_acrn_multiboot_info() api for the early stage. The most of
multiboot info will be initialized during this stage and no debug message need
to be printed. After uart is initialized, the sanitize_multiboot_info() would
do sanitize multiboot info and print needed debug messages.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2020-06-05 12:08:07 +08:00
committed by wenlingz
parent e94922dfdc
commit c74b1941a0
9 changed files with 98 additions and 89 deletions

View File

@@ -24,19 +24,21 @@
struct acrn_multiboot_info {
uint32_t mi_flags; /* the flags is back-compatible with multiboot1 */
char *mi_cmdline;
char *mi_loader_name;
const char *mi_cmdline;
const char *mi_loader_name;
uint32_t mi_mods_count;
const void *mi_mods_va;
struct multiboot_module mi_mods[MAX_MODULE_COUNT];
uint32_t mi_drives_length;
uint32_t mi_drives_addr;
uint32_t mi_mmap_entries;
const void *mi_mmap_va;
struct multiboot_mmap mi_mmap_entry[E820_MAX_ENTRIES];
void *mi_acpi_rsdp;
const void *mi_acpi_rsdp_va;
struct efi_info mi_efi_info;
};
@@ -72,6 +74,7 @@ int32_t multiboot2_to_acrn_mbi(struct acrn_multiboot_info *mbi, void *mb2_info);
#endif
struct acrn_multiboot_info *get_multiboot_info(void);
void init_acrn_multiboot_info(void);
int32_t sanitize_multiboot_info(void);
void parse_hv_cmdline(void);

View File

@@ -16,14 +16,14 @@ enum vboot_mode {
struct vboot_operations {
void (*init)(void);
uint64_t (*get_ap_trampoline)(void);
void *(*get_rsdp)(void);
const void *(*get_rsdp)(void);
void (*init_irq)(void);
};
void init_vboot(void);
void init_vboot_irq(void);
uint64_t get_ap_trampoline_buf(void);
void *get_rsdp_ptr(void);
const void *get_rsdp_ptr(void);
enum vboot_mode get_sos_boot_mode(void);