xen/arm: traps: Avoid using BUG_ON() in _show_registers()
authorJulien Grall <julien.grall@arm.com>
Wed, 15 May 2019 16:16:13 +0000 (17:16 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 28 Oct 2019 21:30:49 +0000 (14:30 -0700)
commitcb86f3d039fcb6afa7b6ee3738050e08b1e5b71a
tree18957a94aa4b3da5f9441dc672f4a81ef105678c
parent8bfcd2e5fd1c6a8a64cd29aab6114826cd5e5be5
xen/arm: traps: Avoid using BUG_ON() in _show_registers()

At the moment, _show_registers() is using a BUG_ON() to assert only
userspace will run 32-bit code in a 64-bit domain.

Such extra precaution is not necessary and could be avoided by only
checking the CPU mode to decide whether show_registers_64() or
show_reigsters_32() should be called.

This has also the nice advantage to avoid nested if in the code.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit e04818b46d6b08ae22d4ef05fa4dc685bba42f57)
xen/arch/arm/traps.c