arm64: kvm: Migrate hyp-init to SMCCC

This makes all KVM HVCs consistent in their use of SMCCC by removing the
custom mechanism previously used by hyp-init.

Some care is taken to only clobber the registers x0-3 before the context
is saved as only those may be clobbered accoring to SMCCC. This is
acheived in __do_hyp_init by storing tpidr_el2 before checking the
function ID since tpidr_el2 won't be used until the correct function ID
is passed. The page table setup scratch registers are then remapped from
x{4,5,6} to x{0,1,2}.

Signed-off-by: Andrew Scull <>
6 files changed