Skip to content

Exception handling in HYP mode on ARMv7-A

Jim Posen u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyIn review
  2. v1 RFC5 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Fix CP15 register written to in start.S
- Check processor mode as HVBAR register is only accessible in HYP mode
- Add QEMU config option for ARM32 with virtualization extensions

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Compile for ARMv7-A with virtualization extensionsarch/arm/Makefile arch/arm/mach-bcm283x/Kconfig arch/arm/mach-exynos/Kconfig+8 -00 replies
2/6Hypervisor mode interrupt vector tablearch/arm/lib/vectors.S+95 -00 replies
3/6Set HVBAR register correctlyarch/arm/cpu/armv7/start.S arch/arm/lib/relocate.S+21 -00 replies
4/6Remove dead codearch/arm/lib/vectors.S+1 -310 replies
5/6Fix PC adjustment logic in exception handlersarch/arm/include/asm/u-boot-arm.h arch/arm/lib/interrupts.c arch/arm/lib/vectors.S+23 -210 replies
6/6Config to target QEMU virt machine with virtualizationarch/arm/mach-qemu/Kconfig+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] Exception handling in HYP mode on ARMv7-A

Currently, when U-Boot is running in hypervisor mode on ARMv7-A CPUs with virtualization extensions, the exception handling does not work. A couple things need to change which are detailed in my earlier message to the u-boot mailing list with the subject "Exception handling in HYP mode on ARMv7-A".

I have verified that this patch series works on the ODroid XU4 and the Raspberry Pi 3B in Aarch32 mode when running in hypervisor mode. One simple way to verify is by running the miscellaneous "exception" command (CMD_EXCEPTION).

This can be tested with QEMU now. Configure with qemu_arm_defconfig and add CMD_EXCEPTION and QEMU_ARM_32BIT_HAS_VIRT. Then run

qemu-system-arm \
    -machine virt,virtualization \
                -nographic -serial mon:stdio \
                -bios u-boot.bin

U-Boot 2021.10-...
...
=> exception undefined

Changes in v2:
- Fix CP15 register written to in start.S
- Check processor mode as HVBAR register is only accessible in HYP mode
- Add QEMU config option for ARM32 with virtualization extensions

Jim Posen (6):
Compile for ARMv7-A with virtualization extensions Hypervisor mode interrupt vector table
Set HVBAR register correctly
Remove dead code
Fix PC adjustment logic in exception handlers Config to target QEMU virt machine with virtualization

 arch/arm/Makefile                 |   4 +
 arch/arm/cpu/armv7/start.S        |   8 ++
 arch/arm/include/asm/u-boot-arm.h |  14 ++--
 arch/arm/lib/interrupts.c         |  26 +++---
 arch/arm/lib/relocate.S           |  13 +++
 arch/arm/lib/vectors.S            | 129 +++++++++++++++++++++++-------
 arch/arm/mach-bcm283x/Kconfig     |   3 +
 arch/arm/mach-exynos/Kconfig      |   1 +
 arch/arm/mach-qemu/Kconfig        |   6 ++
 9 files changed, 153 insertions(+), 51 deletions(-)
Signature · 1 line
2.25.1