mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user