xen/arm: traps: Rework entry/exit from the guest path
authorJulien Grall <julien.grall@arm.com>
Thu, 31 Oct 2019 15:09:12 +0000 (15:09 +0000)
committerJulien Grall <julien.grall@arm.com>
Fri, 1 Nov 2019 13:57:54 +0000 (13:57 +0000)
commitadaecef58e293333c9cdf7780118e8b125ed2634
tree0ccbfbe7f7bc844e66079c23452ae4d4ea6968ac
parent354b0f20783cfb8b8536b6e350e7b9f029b2603b
xen/arm: traps: Rework entry/exit from the guest path

At the moment, enter_hypervisor_head() and leave_hypervisor_tail() are
used to deal with actions to be done before/after any guest request is
handled.

While they are meant to work in pair, the former is called for most of
the traps, including traps from the same exception level (i.e.
hypervisor) whilst the latter will only be called when returning to the
guest.

As pointed out, the enter_hypervisor_head() is not called from all the
traps, so this makes potentially difficult to extend it for the dealing
with same exception level.

Furthermore, some assembly only path will require to call
enter_hypervisor_tail(). So the function is now directly call by
assembly in for guest vector only. This means that the check whether we
are called in a guest trap can now be removed.

Take the opportunity to rename enter_hypervisor_tail() and
leave_hypervisor_tail() to something more meaningful and document them.
This should help everyone to understand the purpose of the two
functions.

Note that enter_hypervisor_tail() does not take any parameters anymore
as after the rework, the code does not use them anymore.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/arm/arm32/entry.S
xen/arch/arm/arm64/entry.S
xen/arch/arm/traps.c