mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 05:30:24 +00:00
HV: modularization: remove mi_flags from acrn boot info
The mi_flags is not needed any more so remove it from acrn_boot_info struct; Tracked-On: #5661 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
parent
23222d0192
commit
56c52d0b95
@ -45,9 +45,7 @@ static uint32_t parse_seed_arg(void)
|
||||
uint32_t i = SEED_ARG_NUM - 1U;
|
||||
uint32_t len;
|
||||
|
||||
if ((abi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) != 0U) {
|
||||
cmd_src = abi->mi_cmdline;
|
||||
}
|
||||
cmd_src = abi->mi_cmdline;
|
||||
|
||||
if (cmd_src != NULL) {
|
||||
for (i = 0U; seed_arg[i].str != NULL; i++) {
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <boot.h>
|
||||
#include <rtl.h>
|
||||
#include <logmsg.h>
|
||||
#include "multiboot/multiboot_priv.h"
|
||||
|
||||
static struct acrn_boot_info acrn_bi = { 0U };
|
||||
static char boot_protocol_name[16U] = { 0 };
|
||||
@ -30,30 +29,18 @@ int32_t sanitize_acrn_boot_info(struct acrn_boot_info *abi)
|
||||
{
|
||||
int32_t abi_status = 0;
|
||||
|
||||
if (abi->mi_mmap_entries != 0U) {
|
||||
abi->mi_flags |= MULTIBOOT_INFO_HAS_MMAP;
|
||||
} else {
|
||||
abi->mi_flags &= ~MULTIBOOT_INFO_HAS_MMAP;
|
||||
}
|
||||
|
||||
if (abi->mi_mods_count != 0U) {
|
||||
abi->mi_flags |= MULTIBOOT_INFO_HAS_MODS;
|
||||
} else {
|
||||
abi->mi_flags &= ~MULTIBOOT_INFO_HAS_MODS;
|
||||
}
|
||||
|
||||
if ((abi->mi_flags & MULTIBOOT_INFO_HAS_MODS) == 0U) {
|
||||
pr_err("no multiboot module info found");
|
||||
if (abi->mi_mods_count == 0U) {
|
||||
pr_err("no boot module info found");
|
||||
abi_status = -EINVAL;
|
||||
}
|
||||
|
||||
if ((abi->mi_flags & MULTIBOOT_INFO_HAS_MMAP) == 0U) {
|
||||
pr_err("wrong multiboot flags: 0x%08x", abi->mi_flags);
|
||||
if (abi->mi_mmap_entries == 0U) {
|
||||
pr_err("no boot mmap info found");
|
||||
abi_status = -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MULTIBOOT2
|
||||
if ((abi->mi_flags & (MULTIBOOT_INFO_HAS_EFI64 | MULTIBOOT_INFO_HAS_EFI_MMAP)) == 0U) {
|
||||
if ((abi->mi_efi_info.efi_systab == 0U) && (abi->mi_efi_info.efi_systab_hi == 0U)) {
|
||||
pr_err("no multiboot2 uefi info found!");
|
||||
}
|
||||
#endif
|
||||
@ -70,7 +57,6 @@ int32_t sanitize_acrn_boot_info(struct acrn_boot_info *abi)
|
||||
|
||||
/*
|
||||
* @post retval != NULL
|
||||
* @post retval->mi_flags & MULTIBOOT_INFO_HAS_MMAP != 0U
|
||||
* @post (retval->mi_mmap_entries > 0U) && (retval->mi_mmap_entries <= MAX_MMAP_ENTRIES)
|
||||
*/
|
||||
struct acrn_boot_info *get_acrn_boot_info(void)
|
||||
|
@ -140,7 +140,7 @@ static void init_vm_bootargs_info(struct acrn_vm *vm, const struct acrn_boot_inf
|
||||
* This is very helpful when one of configured bootargs need to be revised at GRUB runtime
|
||||
* (e.g. "root="), since the later one would override the previous one if multiple bootargs exist.
|
||||
*/
|
||||
if (((abi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) != 0U) && (*(abi->mi_cmdline) != '\0')) {
|
||||
if ((abi->mi_cmdline != NULL) && (*(abi->mi_cmdline) != '\0')) {
|
||||
if (strncat_s((char *)vm->sw.bootargs_info.src_addr, MAX_BOOTARGS_SIZE,
|
||||
abi->mi_cmdline, (MAX_BOOTARGS_SIZE - 1U)) != 0) {
|
||||
pr_err("failed to merge mbi cmdline to SOS bootargs!");
|
||||
|
@ -23,7 +23,6 @@
|
||||
#define ACPI_MODULE_SIZE MEM_1M
|
||||
|
||||
struct acrn_boot_info {
|
||||
uint32_t mi_flags; /* the flags is back-compatible with multiboot1 */
|
||||
|
||||
const char *mi_cmdline;
|
||||
const char *mi_loader_name;
|
||||
|
@ -18,7 +18,6 @@ int32_t multiboot_to_acrn_bi(struct acrn_boot_info *abi, void *mb_info) {
|
||||
struct multiboot_mmap *mmap = (struct multiboot_mmap *)hpa2hva_early((uint64_t)mbi->mi_mmap_addr);
|
||||
struct multiboot_module *mods = (struct multiboot_module *)hpa2hva_early((uint64_t)mbi->mi_mods_addr);
|
||||
|
||||
abi->mi_flags = mbi->mi_flags;
|
||||
abi->mi_cmdline = (char *)hpa2hva_early((uint64_t)mbi->mi_cmdline);
|
||||
abi->mi_loader_name = (char *)hpa2hva_early((uint64_t)mbi->mi_loader_name);
|
||||
abi->mi_mmap_entries = mbi->mi_mmap_length / sizeof(struct multiboot_mmap);
|
||||
|
@ -51,8 +51,8 @@ static void mb2_efi64_to_abi(struct acrn_boot_info *abi, const struct multiboot2
|
||||
{
|
||||
const uint32_t efiloader_sig = 0x34364c45; /* "EL64" */
|
||||
abi->mi_efi_info.efi_systab = (uint32_t)(uint64_t)mb2_tag_efi64->pointer;
|
||||
abi->mi_efi_info.efi_systab_hi = (uint32_t)((uint64_t)mb2_tag_efi64->pointer >> 32U);
|
||||
abi->mi_efi_info.efi_loader_signature = efiloader_sig;
|
||||
abi->mi_flags |= MULTIBOOT_INFO_HAS_EFI64;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -66,7 +66,6 @@ static void mb2_efimmap_to_abi(struct acrn_boot_info *abi,
|
||||
abi->mi_efi_info.efi_memmap = (uint32_t)(uint64_t)mb2_tag_efimmap->efi_mmap;
|
||||
abi->mi_efi_info.efi_memmap_size = mb2_tag_efimmap->size - 16U;
|
||||
abi->mi_efi_info.efi_memmap_hi = (uint32_t)(((uint64_t)mb2_tag_efimmap->efi_mmap) >> 32U);
|
||||
abi->mi_flags |= MULTIBOOT_INFO_HAS_EFI_MMAP;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,7 +86,6 @@ int32_t multiboot2_to_acrn_bi(struct acrn_boot_info *abi, void *mb2_info)
|
||||
switch (mb2_tag->type) {
|
||||
case MULTIBOOT2_TAG_TYPE_CMDLINE:
|
||||
abi->mi_cmdline = ((struct multiboot2_tag_string *)mb2_tag)->string;
|
||||
abi->mi_flags |= MULTIBOOT_INFO_HAS_CMDLINE;
|
||||
break;
|
||||
case MULTIBOOT2_TAG_TYPE_MMAP:
|
||||
mb2_mmap_to_abi(abi, (const struct multiboot2_tag_mmap *)mb2_tag);
|
||||
|
@ -7,10 +7,6 @@
|
||||
#ifndef MULTIBOOT_PRIV_H
|
||||
#define MULTIBOOT_PRIV_H
|
||||
|
||||
/* extended flags for acrn multiboot info from multiboot2 */
|
||||
#define MULTIBOOT_INFO_HAS_EFI_MMAP 0x00010000U
|
||||
#define MULTIBOOT_INFO_HAS_EFI64 0x00020000U
|
||||
|
||||
static inline bool boot_from_multiboot(uint32_t magic, uint32_t info)
|
||||
{
|
||||
return ((magic == MULTIBOOT_INFO_MAGIC) && (info != 0U));
|
||||
|
@ -31,9 +31,7 @@ static void parse_hvdbg_cmdline(void)
|
||||
const char *end = NULL;
|
||||
struct acrn_boot_info *abi = get_acrn_boot_info();
|
||||
|
||||
if ((abi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) != 0U) {
|
||||
start = abi->mi_cmdline;
|
||||
}
|
||||
start = abi->mi_cmdline;
|
||||
|
||||
while ((start != NULL) && ((*start) != '\0')) {
|
||||
while ((*start) == ' ')
|
||||
|
Loading…
Reference in New Issue
Block a user