HV: modularization to refine boot/bsp related code.

1. add static for local functions and variables.
2. move vm_sw_loader from vcpu to vm
3. refine uefi.c to follow the code rules.
4. separate uefi.c for vm0 boot and bsp two parts. bsp layer just
access native HW related, can't access vm/vcpu, vm0 boot part can
access vm / vcpu data structure.

Tracked-On: #1842
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Minggui Cao
2019-01-02 16:01:10 +08:00
committed by wenlingz
parent 4c541ba18c
commit c5e072432a
8 changed files with 110 additions and 71 deletions

View File

@@ -9,8 +9,6 @@
#include <vm0_boot.h>
#include <security.h>
vm_sw_loader_t vm_sw_loader;
inline uint64_t vcpu_get_gpreg(const struct acrn_vcpu *vcpu, uint32_t reg)
{
const struct run_context *ctx =

View File

@@ -9,6 +9,9 @@
#include <multiboot.h>
#include <e820.h>
#include <vtd.h>
#include <vm0_boot.h>
vm_sw_loader_t vm_sw_loader;
/* Local variables */
@@ -101,6 +104,8 @@ int32_t create_vm(struct vm_description *vm_desc, struct acrn_vm **rtn_vm)
#ifndef CONFIG_EFI_STUB
status = init_vm_boot_info(vm);
#else
status = efi_boot_init();
#endif
if (status == 0) {
init_iommu_vm0_domain(vm);