[PATCH v1] mach-snapdragon: Add KVM hypervisor support
Pavan Kondeti
pavan.kondeti at oss.qualcomm.com
Wed Apr 22 11:13:44 CEST 2026
On Mon, Apr 20, 2026 at 07:15:13PM +0530, Sumit Garg wrote:
> On Sun, Apr 19, 2026 at 11:08:29PM +0530, Aswin Murugan wrote:
> > Enable Linux KVM virtualization on Snapdragon SoCs.
> >
> > Introduce CONFIG_QCOM_KVM_SUPPORT to select KVM or Gunyah
> > hypervisor modes at build time.
> >
> > qcom-priv.h:
> > - Add TrustZone SMC interface definitions and parameter IDs
> > - Define hypervisor boot types (GUNYAH=0, KVM=1)
> > - Add TCR_EL2 bit field definitions for memory config
> >
> > board.c:
> > - Add qcom_configure_kvm_hypervisor() with EL-aware logic
> > - EL2: Perform direct SMC call for hypervisor setup
> > - EL1: Save context, disable caches, run SMC, restore state,
> > reconfigure TCR_EL2, re-enable caches
>
> Please don't switch EL1 -> EL2 in the middle of U-Boot execution which
> just adds these expensive MMU operations during boot.
>
> Rather than that just follow the upstream edk2 example to switch from
> EL1 -> EL2 on the first platform specific init code code sequence. Have
> a look at this reference [1]. Surely you can keep the switch under a
> config option. This will make U-Boot to properly execute either in EL1
> or EL2.
>
> [1] https://github.com/tianocore/edk2-platforms/blob/master/Silicon/Qualcomm/KodiakPkg/Library/KodiakLib/KodiakHelper.S
>
Thanks Sumit for pointing this out. In one of our implementation, we are doing
this EL1->EL2 switch as part of ExitBootServices(). As you mentioned in the commit
description [1] , this seems one step closer to recommended boot flow.
Thanks,
Pavan
[1]
https://github.com/tianocore/edk2-platforms/commit/0a51cc11dd74be199c67eceabc7bf68d36bb7075
More information about the U-Boot
mailing list