mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-08 08:26:55 +00:00
currently, ACRN hypervisor can either boot from sbl/abl or uefi, that's why we have different firmware method under bsp & boot dirs. but the fact is that we actually have two different operations based on different guest boot mode: 1. de-privilege-boot: ACRN hypervisor will boot VM0 in the same context as native(before entering hypervisor) - it means hypervisor will co-work with ACRN UEFI bootloader, restore the context env and de-privilege this env to VM0 guest. 2. direct-boot: ACRN hypervisor will directly boot different pre-launched VM(including SOS), it will setup guest env by pre-defined configuration, and prepare guest kernel image, ramdisk which fetch from multiboot modules. this patch is trying to: - rename files related with firmware, change them to guest vboot related - restruct all guest boot stuff in boot & bsp dirs into a new boot/guest dir - use de-privilege & direct boot to distinguish two different boot operations this patch is pure file movement, the rename of functions based on old assumption will be in the following patch. Changes to be committed: modified: ../efi-stub/Makefile modified: ../efi-stub/boot.c modified: Makefile modified: arch/x86/cpu.c modified: arch/x86/guest/vm.c modified: arch/x86/init.c modified: arch/x86/irq.c modified: arch/x86/trampoline.c modified: boot/acpi.c renamed: bsp/cmdline.c -> boot/cmdline.c renamed: bsp/firmware_uefi.c -> boot/guest/deprivilege_boot.c renamed: boot/uefi/uefi_boot.c -> boot/guest/deprivilege_boot_info.c renamed: bsp/firmware_sbl.c -> boot/guest/direct_boot.c renamed: boot/sbl/multiboot.c -> boot/guest/direct_boot_info.c renamed: bsp/firmware_wrapper.c -> boot/guest/vboot_wrapper.c modified: boot/include/acpi.h renamed: bsp/include/firmware_uefi.h -> boot/include/guest/deprivilege_boot.h renamed: bsp/include/firmware_sbl.h -> boot/include/guest/direct_boot.h renamed: bsp/include/firmware.h -> boot/include/guest/vboot.h modified: include/arch/x86/multiboot.h Tracked-On: #1842 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
55 lines
1.1 KiB
C
55 lines
1.1 KiB
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <types.h>
|
|
#include <errno.h>
|
|
#include <multiboot.h>
|
|
#include <pgtable.h>
|
|
#include <dbg_cmd.h>
|
|
#include <logmsg.h>
|
|
|
|
#define ACRN_DBG_PARSE 6
|
|
|
|
int32_t parse_hv_cmdline(void)
|
|
{
|
|
const char *start;
|
|
const char *end;
|
|
struct multiboot_info *mbi = NULL;
|
|
|
|
if (boot_regs[0] != MULTIBOOT_INFO_MAGIC) {
|
|
ASSERT(0, "no multiboot info found");
|
|
return -EINVAL;
|
|
}
|
|
|
|
mbi = (struct multiboot_info *)(hpa2hva((uint64_t)boot_regs[1]));
|
|
dev_dbg(ACRN_DBG_PARSE, "Multiboot detected, flag=0x%x", mbi->mi_flags);
|
|
|
|
if (!(mbi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE)) {
|
|
dev_dbg(ACRN_DBG_PARSE, "no hv cmdline!");
|
|
return -EINVAL;
|
|
}
|
|
|
|
start = (char *)hpa2hva((uint64_t)mbi->mi_cmdline);
|
|
dev_dbg(ACRN_DBG_PARSE, "hv cmdline: %s", start);
|
|
|
|
do {
|
|
while (*start == ' ')
|
|
start++;
|
|
|
|
end = start + 1;
|
|
while (*end != ' ' && *end)
|
|
end++;
|
|
|
|
if (!handle_dbg_cmd(start, end - start)) {
|
|
/* if not handled by handle_dbg_cmd, it can be handled further */
|
|
}
|
|
start = end + 1;
|
|
|
|
} while (*end && *start);
|
|
|
|
return 0;
|
|
}
|