]> xenbits.xensource.com Git - xen.git/commit
xen/arm: entry: Ensure the guest state is synced when receiving a vSError 4.13.0-rc2
authorJulien Grall <julien.grall@arm.com>
Tue, 24 Sep 2019 17:58:39 +0000 (18:58 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 1 Nov 2019 14:34:39 +0000 (14:34 +0000)
commita458d3bd0d2585275c128556ec0cbd818c6a7b0d
treeaa8c6af49d2aad9c9c9070e6137f4635ff60194d
parent2e2356c7bd8f99aa42ed60ceed0e4ba4e06adb8f
xen/arm: entry: Ensure the guest state is synced when receiving a vSError

When a SError/Asynchronous Abort generated by the guest has been
consumed, we will skip the handling of the initial exception.

This includes the calls to enter_hypervisor_from_guest{, _noirq} that
is used to synchronize part of the guest state with the internal
representation and re-enable workarounds (e.g. SSBD). However, we still
call leave_hypervisor_to_guest() which is used for preempting the guest
and synchronizing back part of the guest state.

enter_hypervisor_from_guest{, _noirq} works in pair with
leave_hypervisor_to_guest(), so skipping the first two may result
in a loss of some part of guest state.

An example is the new vGIC which will save the state of the LRs on exit
from the guest and rewrite all of them on entry to the guest.

A more worrying example is SSBD workaround may not be re-enabled. If
leave_hypervisor_to_guest() is rescheduling the vCPU, then we may end to
run a lot of code with SSBD workaroud disabled.

For now, calling leave_hypervisor_to_guest() is not necessary when
injecting a vSError to the guest. But it would still be good to give an
opportunity to reschedule. So both enter_hypervisor_from_guest() and
leave_hypervisor_to_guest() are called.

Note that on arm64, the return value for check_pending_vserror is now
stored in x19 instead of x0. This is because we want to keep the value
across call to C-functions (x0, unlike x19, will not be saved by the
callee).

Take the opportunity to rename check_pending_vserror() to
check_pending_guest_serror() as the function is dealing with host SError
and *not* virtual SError. The documentation is also updated accross
Arm32 and Arm64 to clarify how Xen is dealing with SError generated by
the guest.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-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