xen/arm: io: Distinguish unhandled IO from aborted one
authorJulien Grall <julien.grall@arm.com>
Fri, 2 Feb 2018 10:14:42 +0000 (10:14 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 2 Feb 2018 22:41:13 +0000 (14:41 -0800)
commitc8f0e367bbf9877588f64d01f484f561c979501a
treefa7082a7191267c0730d9043e22407ae8f778ec6
parent38d815cae108b70f35c27e3a6cdf5700a4d00f34
xen/arm: io: Distinguish unhandled IO from aborted one

Currently, Xen is considering that an IO could either be handled or
unhandled. When unhandled, the stage-2 abort function will try another
way to resolve the abort.

However, the MMIO emulation may return unhandled when the address
belongs to an emulated range but was not correct. In that case, Xen
should avoid to try another way and directly inject a guest data abort.

Introduce a tri-state return to distinguish the following state:
    * IO_ABORT: The IO was handled but resulted in an abort
    * IO_HANDLED: The IO was handled
    * IO_UNHANDLED: The IO was unhandled

For now, it is considered that an IO belonging to an emulated range
could either be handled or inject an abort. This could be revisit in the
future if overlapped region exist (or we want to try another way to
resolve the abort).

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