xen/arm: traps: Rework leave_hypervisor_tail
authorJulien Grall <julien.grall@arm.com>
Mon, 26 Nov 2018 14:25:54 +0000 (14:25 +0000)
committerJulien Grall <julien.grall@arm.com>
Wed, 12 Dec 2018 16:09:11 +0000 (16:09 +0000)
commit927ea50066ba8d1914e1e1801ad9341419c206c4
tree19f92789a9425d885b9ade1d5246e9591310addb
parent0bc1a7b3005c91695ddebf7841ef81d12e0e435e
xen/arm: traps: Rework leave_hypervisor_tail

The function leave_hypervisor_tail is called before each return to the
guest vCPU. It has two main purposes:
    1) Process physical CPU work (e.g rescheduling) if required
    2) Prepare the physical CPU to run the guest vCPU

2) will always be done once we finished to process physical CPU work. At
the moment, it is done part of the last iterations of 1) making adding
some extra indentation in the code.

This could be streamlined by moving out 2) of the loop. At the same
time, 1) is moved in a separate function making more obvious what is
happening.

All those changes will help a follow-up patch where we would want to
introduce some vCPU work before returning to the guest vCPU.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c