]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Init MAIR/TCR_EL2 from params struct
authorDavid Brazdil <dbrazdil@google.com>
Wed, 2 Dec 2020 18:41:07 +0000 (18:41 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 4 Dec 2020 10:08:33 +0000 (10:08 +0000)
commit8eb91947b3c39e3207ba71054086b15748f7d6e9
treefb516f86a8d54ccb3847673e1e0d3319e63f9661
parent29fbbf5b7148313fc99c9befdf06146d004305a3
KVM: arm64: Init MAIR/TCR_EL2 from params struct

MAIR_EL2 and TCR_EL2 are currently initialized from their _EL1 values.
This will not work once KVM starts intercepting PSCI ON/SUSPEND SMCs
and initializing EL2 state before EL1 state.

Obtain the EL1 values during KVM init and store them in the init params
struct. The struct will stay in memory and can be used when booting new
cores.

Take the opportunity to move copying the T0SZ value from idmap_t0sz in
KVM init rather than in .hyp.idmap.text. This avoids the need for the
idmap_t0sz symbol alias.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201202184122.26046-12-dbrazdil@google.com
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kernel/asm-offsets.c
arch/arm64/kernel/image-vars.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/hyp-init.S