[U-Boot] [PATCH 0/6] ARMv7: Add HYP mode switching support

Andre Przywara andre.przywara at linaro.org
Mon May 6 15:17:44 CEST 2013


(for GIT URL and Changelog see below)

ARM CPUs with the virtualization extension have a new mode called
HYP mode, which allows hypervisors to safely control and monitor
guests. The current hypervisor (KVM and Xen) implementations
require the kernel to be entered in that HYP mode.

This patch series introduces a configuration variable
CONFIG_ARMV7_VIRT which enables code to switch all cores into HYP
mode. This is done automatically during execution of the bootm
command (but could also be done earlier - U-Boot runs fine in HYP
mode without MMU usage).

The process of switching into HYP mode requires the CPU to be in
non-secure state, which requires the GIC to be programmed properly
first. Explanations about the details are in the commit messages
of the respective patches.

The code aims to be as generic as possible, though currently it has
only been tested on the Versatile Express TC-2 board. The last patch
thus enables the feature for that board and relies on the Versatile
Express updates patches sent out lately[1].

For convenience there is now a GIT tree which you can pull these
and the Versatile Express patches from ("hypmode" branch):
git://git.linaro.org/people/aprzywara/u-boot.git

Changes from the RFC version I sent out before:
* not a dedicated command anymore, code run by bootm & friends
* protecting code with #ifdefs to avoid unnecessary inclusion and
  accidental crashing (when accessing restricted registers)
* moving prototypes to header file to meet checkpatch recommendation
* adding comment as proposed by Christoffer

Please review and comment!
Contributions and comments to support other boards are welcome.

Andre.

[1] http://lists.denx.de/pipermail/u-boot/2013-April/151366.html

Andre Przywara (6):
  ARM: add secure monitor handler to switch to non-secure state
  ARM: add assembly routine to switch to non-secure state
  ARM: switch to non-secure state during bootm execution
  ARM: add SMP support for non-secure switch
  ARM: extend non-secure switch to also go into HYP mode
  ARM: VExpress: enable ARMv7 virt support for VExpress A15

 arch/arm/cpu/armv7/start.S          | 129 +++++++++++++++++++++++++++++++++---
 arch/arm/include/asm/armv7.h        |   8 +++
 arch/arm/lib/Makefile               |   2 +
 arch/arm/lib/bootm.c                |  26 ++++++++
 arch/arm/lib/virt-v7.c              | 128 +++++++++++++++++++++++++++++++++++
 include/configs/vexpress_ca15_tc2.h |   3 +
 6 files changed, 286 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/lib/virt-v7.c

-- 
1.7.12.1



More information about the U-Boot mailing list