wtorek, 1 maja 2018

Jacinto J6Eco (DRA72x) hypervisor startup

Normal way to start hypervisor for ARM (e.g. to start XEN) is to start non-secure mode via enter into monitor mode using SMC instruction. Next from exception handler update NS (and HCE) bit in SCR (Secure Configuration Register) register ("1" for non-secure) and exit monitor exception handler in non-secure mode (PL1 to be able to switch into PL2). Additionally before SMC call monitor exception handler must be registered.
Such code (of course far more complicated e.g. due to multicore support) can be found in U-Boot bootloader (u-boot/arch/arm/cpu/armv7/nonsec_virt.S).
Fortunately for J6Eco DRA72x (and J6Entry - DRA71x) everything is already prepared and simple "SMC #1" call is enough to start hypervisor.
Example code:

.arch_extension sec
.arch_extension virt
.text
.align 2
.global start_hypervisor
.type start_hypervisor, function
start_hypervisor:
    ldr r12, =0x102
    ldr r0, =HYPERVISOR_ADDR
    smc #1

References




Brak komentarzy:

Prześlij komentarz