From: Antonios Motakis <[email protected]> We have now enough implemented functionality to return to the root cell. We just need to enable guest traps, which will be handled by the MMU, MMIO, and GIC code we already plugged to the port. Finally, we restore the state of the root cell that we previously stored in the stack.
Signed-off-by: Antonios Motakis <[email protected]> --- hypervisor/arch/arm64/setup.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/arm64/setup.c b/hypervisor/arch/arm64/setup.c index 166b7b6..55dda3e 100644 --- a/hypervisor/arch/arm64/setup.c +++ b/hypervisor/arch/arm64/setup.c @@ -32,6 +32,8 @@ int arch_init_early(void) int arch_cpu_init(struct per_cpu *cpu_data) { int err = 0; + unsigned long hcr = HCR_VM_BIT | HCR_IMO_BIT | HCR_FMO_BIT + | HCR_TSC_BIT | HCR_TAC_BIT | HCR_RW_BIT; /* switch to the permanent page tables */ enable_mmu_el2(hv_paging_structs.root_table); @@ -39,6 +41,9 @@ int arch_cpu_init(struct per_cpu *cpu_data) cpu_data->psci_mbox.entry = 0; cpu_data->mpidr = phys_processor_id(); + /* Setup guest traps */ + arm_write_sysreg(HCR_EL2, hcr); + err = arch_mmu_cpu_cell_init(cpu_data); if (err) return err; @@ -60,8 +65,12 @@ int arch_init_late(void) void __attribute__((noreturn)) arch_cpu_activate_vmm(struct per_cpu *cpu_data) { - trace_error(-EINVAL); - while (1); + struct registers *regs = guest_regs(cpu_data); + + /* return to the caller in Linux */ + arm_write_sysreg(ELR_EL2, regs->usr[30]); + + vmreturn(regs); } int arch_map_device(void *paddr, void *vaddr, unsigned long size) -- 2.8.0.rc3 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
