KVM: arm/arm64: Don't invoke defacto-CnP on first run
When KVM finds itself switching between two vCPUs of the same VM on one physical CPU it has to invalidate the TLB for this VMID to avoid unintended sharing of TLB entries between vCPU. This is done by tracking the 'last_vcpu_ran' as a percpu variable for each vm. kvm_arch_init_vm() is careful to initialise these to an impossible vcpu id, but we never check for this. The first time vm_arch_vcpu_load() is called on a new physical CPU, we will fail the last_ran check and invalidate the TLB. Now that we have an errata workaround in this path, it means we trigger the workaround whenever a guest is migrated to a new CPU. Check for the impossible vcpu id, and skip defacto-CnP. Change-Id: Id2b1fb291ab925a59de2b8fd0e29892898eb4d20 Signed-off-by:James Morse <james.morse@arm.com> Signed-off-by:
Suzuki K Poulose <suzuki.poulose@arm.com> Patch-mainline: linux-arm-kernel @ 11/14/19, 14:59 Signed-off-by:
Srinivas Ramana <sramana@codeaurora.org>
Loading
Please register or sign in to comment