2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #include <asm/setup.h>
14 #include <asm/sysregs.h>
15 #include <jailhouse/entry.h>
16 #include <jailhouse/paging.h>
17 #include <jailhouse/string.h>
19 int arch_init_early(void)
24 int arch_cpu_init(struct per_cpu *cpu_data)
29 * Copy the registers to restore from the linux stack here, because we
30 * won't be able to access it later
32 memcpy(&cpu_data->linux_reg, (void *)cpu_data->linux_sp, NUM_ENTRY_REGS
33 * sizeof(unsigned long));
35 err = switch_exception_level(cpu_data);
38 * Save pointer in the thread local storage
39 * Must be done early in order to handle aborts and errors in the setup
42 arm_write_sysreg(TPIDR_EL2, cpu_data);
47 int arch_init_late(void)
52 void arch_cpu_activate_vmm(struct per_cpu *cpu_data)
54 /* Return to the kernel */
55 cpu_return_el1(cpu_data);
60 void arch_cpu_restore(struct per_cpu *cpu_data)
64 // catch missing symbols
65 #include <jailhouse/printk.h>
66 #include <jailhouse/processor.h>
67 #include <jailhouse/control.h>
68 #include <jailhouse/string.h>
69 void arch_suspend_cpu(unsigned int cpu_id) {}
70 void arch_resume_cpu(unsigned int cpu_id) {}
71 void arch_reset_cpu(unsigned int cpu_id) {}
72 void arch_park_cpu(unsigned int cpu_id) {}
73 void arch_shutdown_cpu(unsigned int cpu_id) {}
74 int arch_cell_create(struct cell *new_cell)
76 int arch_map_memory_region(struct cell *cell,
77 const struct jailhouse_memory *mem)
79 int arch_unmap_memory_region(struct cell *cell,
80 const struct jailhouse_memory *mem)
82 void arch_flush_cell_vcpu_caches(struct cell *cell) {}
83 void arch_cell_destroy(struct cell *new_cell) {}
84 void arch_config_commit(struct cell *cell_added_removed) {}
85 void arch_shutdown(void) {}
86 unsigned long arch_paging_gphys2phys(struct per_cpu *cpu_data,
87 unsigned long gphys, unsigned long flags)
88 { return INVALID_PHYS_ADDR; }
89 void arch_paging_init(void) { }
91 const struct paging arm_paging[1];
93 void arch_panic_stop(void) {__builtin_unreachable();}
94 void arch_panic_park(void) {}