KVM: arm64: Introduce new spinlock for hypervisor VM vCPUs[] array

The vCPU structures of the hypervisor VM struct claim to be protected
by 'vm_table_lock', however:

  1. This doesn't appear to be the case on the PSCI paths, where the
     array is walked locklessly when accessing the target vCPU

  2. The 'vm_table_lock' serialises across all VMs, so is overkill

Introduce a new per-VM spinlock for the vCPU array and ensure that it is
held whilst accessing the data structure.

Signed-off-by: Will Deacon <will@kernel.org>
2 files changed