]> 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)
commit4b9ac285e2535280388bf7e41a627d9f1c535c7a
tree61378ba67bac1ee1f7483ed51213f409f2322bd4
parent0011fbce2460f79785d7b3cb8e7977a73b5a7e6f
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