acrn-hypervisor/hypervisor/boot/guest/direct_boot.c
Jason Chen CJ 238d8bbaa2 reshuffle init_vm_boot_info
now only SOS need decide boot with de-privilege or direct boot mode, while
for other pre-launched VMs, they should use direct boot mode.

this patch merge boot/guest/direct_boot_info.c &
boot/guest/deprivilege_boot_info.c into boot/guest/vboot_info.c,
and change init_direct_vboot_info() function name to init_general_vm_boot_info().

in init_vm_boot_info(), depend on get_sos_boot_mode(), SOS may choose to init
vm boot info by setting the vm_sw_loader to deprivilege specific one; for SOS
using DIRECT_BOOT_MODE and all other VMS, they will use general_sw_loader as
vm_sw_loader and go through init_general_vm_boot_info() for virtual boot vm
info filling.

this patch also move spurious handler initilization for de-privilege mode from
boot/guest/deprivilege_boot.c to boot/guest/vboot_info.c, and just set it in
deprivilege sw_loader before irq enabling.

Changes to be committed:
	modified:   Makefile
	modified:   arch/x86/guest/vm.c
	modified:   boot/guest/deprivilege_boot.c
	deleted:    boot/guest/deprivilege_boot_info.c
	modified:   boot/guest/direct_boot.c
	renamed:    boot/guest/direct_boot_info.c -> boot/guest/vboot_info.c
	modified:   boot/guest/vboot_wrapper.c
	modified:   boot/include/guest/deprivilege_boot.h
	modified:   boot/include/guest/direct_boot.h
	modified:   boot/include/guest/vboot.h
	new file:   boot/include/guest/vboot_info.h
	modified:   common/vm_load.c
	modified:   include/arch/x86/guest/vm.h

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-05-20 18:49:59 +08:00

46 lines
851 B
C

/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* this is for direct guest_boot method */
#include <types.h>
#include <e820.h>
#include <cpu.h>
#include <direct_boot.h>
static void init_direct_boot(void)
{
/* nothing to do for now */
}
/* @post: return != 0UL */
static uint64_t get_direct_boot_ap_trampoline(void)
{
return e820_alloc_low_memory(CONFIG_LOW_RAM_SIZE);
}
static void* get_direct_boot_rsdp(void)
{
return NULL;
}
static void init_direct_boot_irq(void)
{
CPU_IRQ_ENABLE();
}
static struct vboot_operations direct_boot_ops = {
.init = init_direct_boot,
.get_ap_trampoline = get_direct_boot_ap_trampoline,
.get_rsdp = get_direct_boot_rsdp,
.init_irq = init_direct_boot_irq,
};
struct vboot_operations* get_direct_boot_ops(void)
{
return &direct_boot_ops;
}