kvm: arm64: Set up hyp percpu data for nVHE
authorDavid Brazdil <dbrazdil@google.com>
Tue, 22 Sep 2020 20:49:09 +0000 (21:49 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 30 Sep 2020 07:37:14 +0000 (08:37 +0100)
commit30c953911c4370bfb622ee1c2fcc7e78c84df800
tree525991f0ee45ff0992dae3b2858030d5f622b1d2
parent2a1198c9b436402582f7beed57028044b819329c
kvm: arm64: Set up hyp percpu data for nVHE

Add hyp percpu section to linker script and rename the corresponding ELF
sections of hyp/nvhe object files. This moves all nVHE-specific percpu
variables to the new hyp percpu section.

Allocate sufficient amount of memory for all percpu hyp regions at global KVM
init time and create corresponding hyp mappings.

The base addresses of hyp percpu regions are kept in a dynamically allocated
array in the kernel.

Add NULL checks in PMU event-reset code as it may run before KVM memory is
initialized.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20200922204910.7265-10-dbrazdil@google.com
arch/arm64/include/asm/kvm_asm.h
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/hyp.lds.S
arch/arm64/kvm/pmu.c