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>
This commit is contained in:
Jason Chen CJ
2019-05-13 20:14:02 +08:00
committed by ACRN System Integration
parent 0018da4114
commit 238d8bbaa2
13 changed files with 92 additions and 97 deletions

View File

@@ -19,6 +19,5 @@ const struct depri_boot_context *get_depri_boot_ctx(void);
const struct lapic_regs *get_depri_boot_lapic_regs(void);
struct vboot_operations* get_deprivilege_boot_ops(void);
int32_t init_depri_vboot_info(__unused struct acrn_vm *vm);
#endif /* end of include guard: DEPRIVILEGE_BOOT_H */

View File

@@ -11,6 +11,5 @@
#include <vboot.h>
struct vboot_operations* get_direct_boot_ops(void);
int32_t init_direct_vboot_info(struct acrn_vm *vm);
#endif /* end of include guard: DIRECT_BOOT_H */

View File

@@ -13,19 +13,16 @@ enum vboot_mode {
DEPRI_BOOT_MODE
};
struct acrn_vm;
struct vboot_operations {
void (*init)(void);
uint64_t (*get_ap_trampoline)(void);
void *(*get_rsdp)(void);
void (*init_irq)(void);
int32_t (*init_vboot_info)(struct acrn_vm *vm);
};
void init_vboot_operations(void);
void init_vboot(void);
void init_vboot_irq(void);
int32_t init_vm_boot_info(struct acrn_vm *vm);
uint64_t get_ap_trampoline_buf(void);
void *get_rsdp_ptr(void);

View File

@@ -0,0 +1,13 @@
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef VBOOT_INFO_H
#define VBOOT_INFO_H
int32_t init_vm_boot_info(struct acrn_vm *vm);
#endif /* end of include guard: VBOOT_INFO_H */