diff --git a/components/VM_Arm/src/main.c b/components/VM_Arm/src/main.c index e577d0bd..cb6ec18c 100644 --- a/components/VM_Arm/src/main.c +++ b/components/VM_Arm/src/main.c @@ -531,6 +531,8 @@ static int vmm_init(void) assert(t_id >= 0); } + camkes_io_fdt(&(_io_ops.io_fdt)); + return 0; } @@ -802,9 +804,9 @@ static int generate_fdt(vm_t *vm, void *fdt_ori, void *gen_fdt, int buf_size, si } if (config_set(CONFIG_VM_PCI_SUPPORT)) { - int gic_offset = fdt_path_offset(fdt_ori, GIC_NODE_PATH); + int gic_offset = fdt_path_offset(fdt_ori, vm->gic_path); if (gic_offset < 0) { - ZF_LOGE("Failed to find gic node from path: %s", GIC_NODE_PATH); + ZF_LOGE("Failed to find gic node from path: %s", vm->gic_path); return -1; } int gic_phandle = fdt_get_phandle(fdt_ori, gic_offset); @@ -892,7 +894,6 @@ static int load_linux(vm_t *vm, const char *kernel_name, const char *dtb_name, c close(dtb_fd); fdt_ori = (void *)linux_gen_dtb_base_buf; } else { - camkes_io_fdt(&(_io_ops.io_fdt)); fdt_ori = (void *)ps_io_fdt_get(&_io_ops.io_fdt); } @@ -1166,6 +1167,9 @@ int main_continued(void) ZF_LOGF_IF(err, "Failed to bind CB to SID"); #endif /* CONFIG_ARM_SMMU */ + vm.fdt_ori = (void *)ps_io_fdt_get(&_io_ops.io_fdt); + vm.gic_path = GIC_NODE_PATH; + err = vm_create_default_irq_controller(&vm); assert(!err);