Restore x18 on fast paths as well.
Change-Id: I1f11646abcff8675d32ffbb1644b06d51008c9c6
diff --git a/src/arch/aarch64/exceptions.S b/src/arch/aarch64/exceptions.S
index 4da8997..56f58d9 100644
--- a/src/arch/aarch64/exceptions.S
+++ b/src/arch/aarch64/exceptions.S
@@ -74,6 +74,9 @@
ldp x13, x14, [sp, #-16]
ldp x15, x16, [sp, #-16]
mov x17, xzr
+
+ /* Restore x18, which was saved on the stack. */
+ ldr x18, [sp], #16
eret
.balign 0x80
@@ -370,7 +373,9 @@
stp xzr, xzr, [x18, #8 * 16]
stp x29, x30, [x18, #8 * 29]
- str xzr, [x18, #8 * 18]
+ /* x18 was saved on the stack, so we move it to vcpu regs buffer. */
+ ldr x2, [sp], #16
+ str x2, [x18, #8 * 18]
/* Save return address & mode. */
mrs x2, elr_el2