This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to do the ARM state change between 64-bit and 32-bit Guest OS on Hypervsor?

Hello

If two OS running on 64-bit Hypervisor. One OS is 64-bit and other is 32-bit OS.

How the Hypervisor run both OS? What is programming  sequence( respect to ARM registers) when Hypervisor schedule/run one after other OS?

 

I only knows that RMR_ELx use for 32-bit to 64-bit transition but How it will use in Hypervisor based environment?

 

I have same question with respect to secure world.

If two OS running in secure world say one is TEE(64-bit) and RTOS(32-bit). How the monitor(running in EL3)  handle this?

 

Thanks

Bharat

 

Parents
  • Hi Bharat,

    RMR_EL3 controls 64bit-ness over a warm reboot. EL2 does this in a slightly different way when changing guest OSs.

    ARMv8 gives the opportunity to change execution state when taking or returning from an exception. Guest OSs are swapped in an out in response to an exception (usually a timer IRQ) so the 64bit-ness can be changed too.

    If the 64bit GuestOS is running and the timer fires, an exception will be taken to EL2. If the hypervisor decides to do some scheduling it will save all the EL1 register values to RAM and load in the new, 32bit values belonging to 32bit GuestOS. It will then configure EL1 to be AArch32 using HCR_EL2.RW and perform an exception return. SPSR_EL1[4:0] also affect target mode so will also indicate a 32bit EL1.

    Going from 32 back to 64bit EL1 would work in the same way.

    The secure world isn't really set up to run more than one secure OS. EL3 controls the 64bit-ness of Secure EL1 in a similar way as above but the secure world lacks some of the other features useful for running GuestOSes such a 2-stage translation and VMIDs which makes swapping GuestOSs difficult.

    Pete.
Reply
  • Hi Bharat,

    RMR_EL3 controls 64bit-ness over a warm reboot. EL2 does this in a slightly different way when changing guest OSs.

    ARMv8 gives the opportunity to change execution state when taking or returning from an exception. Guest OSs are swapped in an out in response to an exception (usually a timer IRQ) so the 64bit-ness can be changed too.

    If the 64bit GuestOS is running and the timer fires, an exception will be taken to EL2. If the hypervisor decides to do some scheduling it will save all the EL1 register values to RAM and load in the new, 32bit values belonging to 32bit GuestOS. It will then configure EL1 to be AArch32 using HCR_EL2.RW and perform an exception return. SPSR_EL1[4:0] also affect target mode so will also indicate a 32bit EL1.

    Going from 32 back to 64bit EL1 would work in the same way.

    The secure world isn't really set up to run more than one secure OS. EL3 controls the 64bit-ness of Secure EL1 in a similar way as above but the secure world lacks some of the other features useful for running GuestOSes such a 2-stage translation and VMIDs which makes swapping GuestOSs difficult.

    Pete.
Children
No data