AArch64 EL2 hypervisor for QEMU virt that boots at EL2
1.section .text, "ax"
2.global arch_vcpu_enter
3.type arch_vcpu_enter, %function
4arch_vcpu_enter:
5 msr daifset, #0xf
6 mov x30, x0
7 ldr x1, [x30, #248]
8 msr sp_el0, x1
9 ldr x1, [x30, #256]
10 msr sp_el1, x1
11 ldr x1, [x30, #264]
12 msr elr_el2, x1
13 ldr x1, [x30, #272]
14 msr spsr_el2, x1
15 ldp x0, x1, [x30, #0]
16 ldp x2, x3, [x30, #16]
17 ldp x4, x5, [x30, #32]
18 ldp x6, x7, [x30, #48]
19 ldp x8, x9, [x30, #64]
20 ldp x10, x11, [x30, #80]
21 ldp x12, x13, [x30, #96]
22 ldp x14, x15, [x30, #112]
23 ldp x16, x17, [x30, #128]
24 ldp x18, x19, [x30, #144]
25 ldp x20, x21, [x30, #160]
26 ldp x22, x23, [x30, #176]
27 ldp x24, x25, [x30, #192]
28 ldp x26, x27, [x30, #208]
29 ldp x28, x29, [x30, #224]
30 ldr x30, [x30, #240]
31 eret