KVM: arm64: Create nVHE copy of cpu_logical_map
authorDavid Brazdil <dbrazdil@google.com>
Wed, 2 Dec 2020 18:41:10 +0000 (18:41 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 4 Dec 2020 10:08:34 +0000 (10:08 +0000)
commit94f5e8a4642aedb19ca73f534372d7ed65e1c84e
tree953eef01f576a913fa3088803ae225dd2b7ba35e
parent687413d34d4aa72103de3e545f431f480dd21d7f
KVM: arm64: Create nVHE copy of cpu_logical_map

When KVM starts validating host's PSCI requests, it will need to map
MPIDR back to the CPU ID. To this end, copy cpu_logical_map into nVHE
hyp memory when KVM is initialized.

Only copy the information for CPUs that are online at the point of KVM
initialization so that KVM rejects CPUs whose features were not checked
against the finalized capabilities.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201202184122.26046-15-dbrazdil@google.com
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/hyp-smp.c