diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2024-05-08 10:19:52 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2024-05-08 18:39:41 +0300 |
commit | ce5d2448eb8fe83aed331db53a08612286a137dd (patch) | |
tree | 0b25b657a0a6d3de49234c1ff44387e23f80c365 /arch/arm64/include | |
parent | 5053c3f0519cd4c746577e3a6a7756f7c04b03dd (diff) | |
download | linux-ce5d2448eb8fe83aed331db53a08612286a137dd.tar.xz |
KVM: arm64: Destroy mpidr_data for 'late' vCPU creation
A particularly annoying userspace could create a vCPU after KVM has
computed mpidr_data for the VM, either by racing against VGIC
initialization or having a userspace irqchip.
In any case, this means mpidr_data no longer fully describes the VM, and
attempts to find the new vCPU with kvm_mpidr_to_vcpu() will fail. The
fix is to discard mpidr_data altogether, as it is only a performance
optimization and not required for correctness. In all likelihood KVM
will recompute the mappings when KVM_RUN is called on the new vCPU.
Note that reads of mpidr_data are not guarded by a lock; promote to RCU
to cope with the possibility of mpidr_data being invalidated at runtime.
Fixes: 54a8006d0b49 ("KVM: arm64: Fast-track kvm_mpidr_to_vcpu() when mpidr_data is available")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240508071952.2035422-1-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/include')
0 files changed, 0 insertions, 0 deletions