Skip to content

Commit 51a6bfe

Browse files
committed
refactor(exception): update register usage in vmexit trampoline
- Change register used to save exit reason from x6 to x9 - Change register used to save vcpu_running return value from x7 to x10 - Update conditional branch instruction to use x10 instead of x7
1 parent 21409b9 commit 51a6bfe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/exception.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ fn dispatch_irq() {
263263
#[no_mangle]
264264
unsafe extern "C" fn vmexit_trampoline() {
265265
core::arch::asm!(
266-
"mov x6, x0", // Save the exit reason.
266+
"mov x9, x0", // Save the exit reason.
267267
"bl {vcpu_running}", // Check if vcpu is running.
268-
"mov x7, x0", // Save the return value of vcpu_running.
269-
"mov x0, x6", // Restore the exit reason.
268+
"mov x10, x0", // Save the return value of vcpu_running.
269+
"mov x0, x9", // Restore the exit reason.
270270
// If vcpu_running returns true, jump to `return_run_guest`,
271271
// after that the control flow is handed back to Aarch64VCpu.run(),
272272
// simulating the normal return of the `run_guest` function.
273-
"cbnz x7, {return_run_guest}",
273+
"cbnz x10, {return_run_guest}",
274274
// If vcpu_running returns false, there is no active vcpu running,
275275
// jump to `dispatch_irq`.
276276
"bl {dispatch_irq}",

0 commit comments

Comments
 (0)