hv: Update SOS BSP to use new API to init BSP state

We move the SOS BSP state init to vm loader and drop
function init_guest_context_vm0_bsp.

Update the definition of vm0_boot_context to fix code
violations.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yin Fengwei
2018-09-29 21:14:44 +08:00
committed by wenlingz
parent 26627bd1fc
commit 08c13a9ea8
3 changed files with 18 additions and 44 deletions

View File

@@ -138,6 +138,8 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
}
#endif
set_vcpu_regs(vcpu, (struct acrn_vcpu_regs *)&vm0_boot_context);
/* calculate the kernel entry point */
zeropage = (struct zero_page *)sw_kernel->kernel_src_addr;
kernel_entry_offset = (uint32_t)(zeropage->hdr.setup_sects + 1U) * 512U;
@@ -151,9 +153,10 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
+ kernel_entry_offset);
if (is_vcpu_bsp(vcpu)) {
/* Set VCPU entry point to kernel entry */
vcpu->entry_addr = sw_kernel->kernel_entry_addr;
vcpu_set_rip(vcpu, (uint64_t)sw_kernel->kernel_entry_addr);
pr_info("%s, VM %hu VCPU %hu Entry: 0x%016llx ",
__func__, vm->vm_id, vcpu->vcpu_id, vcpu->entry_addr);
__func__, vm->vm_id, vcpu->vcpu_id,
sw_kernel->kernel_entry_addr);
}
/* Calculate the host-physical address where the guest will be loaded */