Linux kernel set the hypervisor vector table through ATF

Dongjiu Geng gengdongjiu1 at gmail.com
Fri May 28 02:26:51 PDT 2021


Hi All,
      when Linux kernel boot from EL1,  there is no method to let
kernel to enter EL2 to enable hypervisor.  so I want to add an SMC
interface between kernel and EL3 ATF to let kernel can set the
hypervisor vector table,  then can enter EL2 to enable hypervisor, as
shown in [1].
Do you agree?  Otherwise there is no method to enter EL2 hypervisor
when kernel boot from EL1, because the hypervisor vector
table(vbar_el2) is unknown.



[1]:
el1_sync:
        cmp     x0, #SMC_SET_VECTORS
        b.ne    2f
        msr     vbar_el2, x1
        b       9f

2:      cmp     x0, #SMC_SOFT_RESTART
        b.ne    3f
        mov     x0, x2
        mov     x2, x4
        mov     x4, x1
        mov     x1, x3
        br      x4                              // no return

3:      cmp     x0, #SMC_RESET_VECTORS
        beq     9f                              // Nothing to reset!

        ldr     x0, =SMC_STUB_ERR
        eret

9:      mov     x0, xzr
        eret
ENDPROC(el1_sync)



More information about the linux-arm-kernel mailing list