xen/arm: traps: Merge try_handle_mmio() and handle_mmio()
authorJulien Grall <julien.grall@arm.com>
Fri, 2 Feb 2018 10:14:41 +0000 (10:14 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 2 Feb 2018 22:40:59 +0000 (14:40 -0800)
commit38d815cae108b70f35c27e3a6cdf5700a4d00f34
tree09bb45579b75c3cbf3f9c046793fdc4a9a1b11b7
parentdd855aa430f2da9b677c145f0c625a82aaa97110
xen/arm: traps: Merge try_handle_mmio() and handle_mmio()

At the moment, try_handle_mmio() will do check on the HSR and bail out
if one check fail. This means that another method will be tried to
handle the fault even for bad access on emulated region. While this
should not be an issue, this is not future proof.

Move the checks of try_handle_mmio() in handle_mmio() after we identified
the fault to target an emulated MMIO. While this does not fix the potential
fall-through, a follow-up patch will do by distinguish the potential error.

Note that the handle_mmio() was renamed to try_handle_mmio() and the
prototype adapted.

While merging the 2 functions, remove the check whether the fault is
stage-2 abort on stage-1 translation walk because the instruction
syndrome will always be invalid (see B3-1433 in DDI 0406C.c and
D10-2460 in DDI 0487C.a).

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
xen/arch/arm/io.c
xen/arch/arm/traps.c
xen/include/asm-arm/mmio.h