mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
HV: enable load zephyr kernel
Zephyr kernel is stripped ram image, its entry and load address are explicitly defined in vm configurations, hypervisor will load Zephyr directly based on these configurations. Currently we only support boot Zephyr from protected mode. Tracked-On: #3214 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
@@ -150,6 +150,14 @@ static void prepare_loading_bzimage(struct acrn_vm *vm, struct acrn_vcpu *vcpu)
|
||||
__func__, vm->vm_id, vcpu_get_gpreg(vcpu, CPU_REG_RSI));
|
||||
}
|
||||
|
||||
static void prepare_loading_rawimage(struct acrn_vm *vm)
|
||||
{
|
||||
struct sw_kernel_info *sw_kernel = &(vm->sw.kernel_info);
|
||||
const struct acrn_vm_config *vm_config = get_vm_config(vm->vm_id);
|
||||
|
||||
sw_kernel->kernel_entry_addr = (void *)vm_config->os_config.kernel_entry_addr;
|
||||
}
|
||||
|
||||
int32_t direct_boot_sw_loader(struct acrn_vm *vm)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
@@ -185,6 +193,9 @@ int32_t direct_boot_sw_loader(struct acrn_vm *vm)
|
||||
case KERNEL_BZIMAGE:
|
||||
prepare_loading_bzimage(vm, vcpu);
|
||||
break;
|
||||
case KERNEL_ZEPHYR:
|
||||
prepare_loading_rawimage(vm);
|
||||
break;
|
||||
default:
|
||||
pr_err("%s, Loading VM SW failed", __func__);
|
||||
ret = -EINVAL;
|
||||
|
Reference in New Issue
Block a user