diff options
author | Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> | 2021-11-22 13:18:44 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-02-08 15:57:04 +0100 |
commit | 100b4f092f878dc379f1fcef9ce567c25dee3473 (patch) | |
tree | 94812b659483a3d9daf59f9bc0d0e70d3784ccab /arch/arm64/kvm/arm.c | |
parent | KVM: arm64: Align the VMID allocation with the arm64 ASID (diff) | |
download | linux-100b4f092f878dc379f1fcef9ce567c25dee3473.tar.xz linux-100b4f092f878dc379f1fcef9ce567c25dee3473.zip |
KVM: arm64: Make active_vmids invalid on vCPU schedule out
Like ASID allocator, we copy the active_vmids into the
reserved_vmids on a rollover. But it's unlikely that
every CPU will have a vCPU as current task and we may
end up unnecessarily reserving the VMID space.
Hence, set active_vmids to an invalid one when scheduling
out a vCPU.
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211122121844.867-5-shameerali.kolothum.thodi@huawei.com
Diffstat (limited to 'arch/arm64/kvm/arm.c')
-rw-r--r-- | arch/arm64/kvm/arm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index be2fd84d526b..418014998f18 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -417,6 +417,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) kvm_timer_vcpu_put(vcpu); kvm_vgic_put(vcpu); kvm_vcpu_pmu_restore_host(vcpu); + kvm_arm_vmid_clear_active(); vcpu->cpu = -1; } |