]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: KVM: Cleanup stale TLB entries when host CPU changes
authorAnup Patel <apatel@ventanamicro.com>
Mon, 9 May 2022 05:14:11 +0000 (10:44 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 20 May 2022 03:39:18 +0000 (09:09 +0530)
commit00e511be47d502ac478e44bab7c9d1c339c2beb2
tree61378ba67bac1ee1f7483ed51213f409f2322bd4
parent1126a716d2d8f51d12b7837cf2cbad1bb35ea853
RISC-V: KVM: Cleanup stale TLB entries when host CPU changes

On RISC-V platforms with hardware VMID support, we share same
VMID for all VCPUs of a particular Guest/VM. This means we might
have stale G-stage TLB entries on the current Host CPU due to
some other VCPU of the same Guest which ran previously on the
current Host CPU.

To cleanup stale TLB entries, we simply flush all G-stage TLB
entries by VMID whenever underlying Host CPU changes for a VCPU.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/asm/kvm_host.h
arch/riscv/kvm/tlb.c
arch/riscv/kvm/vcpu.c