On 06.11.18 00:05, Ralf Ramsauer wrote:
This is the second step to get rid of arch_handle_exit(). There's no need to
call vmreturn() from arch_handle_exit(). Let's move this to assembly.

Signed-off-by: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de>
---
  hypervisor/arch/arm64/entry.S | 4 +++-
  hypervisor/arch/arm64/traps.c | 2 +-
  2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hypervisor/arch/arm64/entry.S b/hypervisor/arch/arm64/entry.S
index 8cf9dd6b..e0240f00 100644
--- a/hypervisor/arch/arm64/entry.S
+++ b/hypervisor/arch/arm64/entry.S
@@ -315,7 +315,8 @@ bootstrap_vectors:
        mov     x30, xzr
        mov     x0, sp
        bl      arch_handle_exit
-       b       .
+       /* take the fast exit path, sp is already in place */
+       b       __vmreturn

Hmm, the only remaining caller of vmreturn of this is arch_cpu_activate_vmm() which is not really a hot-path. I would suggest to make the common case jump free and let vmreturn jump here instead.

  .endm
.align 11
@@ -413,6 +414,7 @@ shutdown_el2:
  vmreturn:
        /* x0: union registers* */
        mov     sp, x0
+__vmreturn:
        ldp     x29, x30, [sp, #(15 * 16)]
        ldp     x27, x28, [sp, #(14 * 16)]
        ldp     x25, x26, [sp, #(13 * 16)]
diff --git a/hypervisor/arch/arm64/traps.c b/hypervisor/arch/arm64/traps.c
index 42dd9792..ccb86954 100644
--- a/hypervisor/arch/arm64/traps.c
+++ b/hypervisor/arch/arm64/traps.c
@@ -213,5 +213,5 @@ union registers *arch_handle_exit(union registers *regs)
                panic_stop();
        }
- vmreturn(regs);
+       return regs;
  }


Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to