]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Support per_cpu_ptr in nVHE hyp code
authorDavid Brazdil <dbrazdil@google.com>
Wed, 2 Dec 2020 18:41:09 +0000 (18:41 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 4 Dec 2020 10:08:34 +0000 (10:08 +0000)
commit1788694515e3b31701622b0dfb9c452d2434551b
tree5c5c5f2bc574130b660bcfde236eb85bf1aa5184
parent0488a889db2db7f813c7ef82eb186e4966d1f306
KVM: arm64: Support per_cpu_ptr in nVHE hyp code

When compiling with __KVM_NVHE_HYPERVISOR__, redefine per_cpu_offset()
to __hyp_per_cpu_offset() which looks up the base of the nVHE per-CPU
region of the given cpu and computes its offset from the
.hyp.data..percpu section.

This enables use of per_cpu_ptr() helpers in nVHE hyp code. Until now
only this_cpu_ptr() was supported by setting TPIDR_EL2.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201202184122.26046-14-dbrazdil@google.com
arch/arm64/include/asm/percpu.h
arch/arm64/kernel/image-vars.h
arch/arm64/kvm/hyp/nvhe/Makefile
arch/arm64/kvm/hyp/nvhe/hyp-smp.c [new file with mode: 0644]