]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/arm/setup.c
arm: hyp vectors installation
[jailhouse.git] / hypervisor / arch / arm / setup.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013
5  *
6  * Authors:
7  *  Jan Kiszka <jan.kiszka@siemens.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  */
12
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>
18
19 int arch_init_early(void)
20 {
21         return -ENOSYS;
22 }
23
24 int arch_cpu_init(struct per_cpu *cpu_data)
25 {
26         int err = 0;
27
28         /*
29          * Copy the registers to restore from the linux stack here, because we
30          * won't be able to access it later
31          */
32         memcpy(&cpu_data->linux_reg, (void *)cpu_data->linux_sp, NUM_ENTRY_REGS
33                         * sizeof(unsigned long));
34
35         err = switch_exception_level(cpu_data);
36
37         /*
38          * Save pointer in the thread local storage
39          * Must be done early in order to handle aborts and errors in the setup
40          * code.
41          */
42         arm_write_sysreg(TPIDR_EL2, cpu_data);
43
44         return err;
45 }
46
47 int arch_init_late(void)
48 {
49         return -ENOSYS;
50 }
51
52 void arch_cpu_activate_vmm(struct per_cpu *cpu_data)
53 {
54         /* Return to the kernel */
55         cpu_return_el1(cpu_data);
56
57         while (1);
58 }
59
60 void arch_cpu_restore(struct per_cpu *cpu_data)
61 {
62 }
63
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)
75 { return -ENOSYS; }
76 int arch_map_memory_region(struct cell *cell,
77                            const struct jailhouse_memory *mem)
78 { return -ENOSYS; }
79 int arch_unmap_memory_region(struct cell *cell,
80                              const struct jailhouse_memory *mem)
81 { return -ENOSYS; }
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) { }
90
91 const struct paging arm_paging[1];
92
93 void arch_panic_stop(void) {__builtin_unreachable();}
94 void arch_panic_park(void) {}