hv: set start mode of vcpu

In current code, sos/uos bsp can only start from 64bit mode.

For sbl platform:
This patch start sos bsp from protected mode by default.
CONFIG_START_VM0_BSP_64BIT is defined to allow start sos bsp
from 64bit mode. If a config CONFIG_START_VM0_BSP_64BIT
defined in config file, then sos bsp will start from 64bit mode.
This patch start uos bsp from real mode, which needs the integration
of virtual bootloader (vsbl).

For uefi platform:
This patch sets sos bsp vcpu mode according to the uefi context.
This patch starts uos bsp from protected mode, because vsbl is not ready
to publish for uefi platform yet. After vsbl is ready, can change to
start uos bsp from real mode.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
Binbin Wu
2018-05-15 18:21:03 +08:00
committed by lijinxia
parent 0d309e2dee
commit bed6f0b99e
4 changed files with 33 additions and 5 deletions

View File

@@ -122,8 +122,10 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
zeropage = (struct zero_page *)
vm->sw.kernel_info.kernel_src_addr;
kernel_entry_offset = (zeropage->hdr.setup_sects + 1) * 512;
/* 64bit entry is the 512bytes after the start */
kernel_entry_offset += 512;
if (vcpu->arch_vcpu.cpu_mode == CPU_MODE_64BIT)
/* 64bit entry is the 512bytes after the start */
kernel_entry_offset += 512;
vm->sw.kernel_info.kernel_entry_addr =
(void *)((unsigned long)vm->sw.kernel_info.kernel_load_addr
+ kernel_entry_offset);