diff options
| author | Hui Min Mina Chou <minachou@andestech.com> | 2025-11-17 16:45:55 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2025-11-24 09:55:36 +0530 |
| commit | 3239c52fd21257c80579875e74c9956c2f9cd1f9 (patch) | |
| tree | 06498de8ea05a89d34b48fbc35ac3b62c6963e7f /tools/testing/selftests/kvm/include/kvm_util.h | |
| parent | 974555d6e417974e63444266e495a06d06c23af5 (diff) | |
RISC-V: KVM: Flush VS-stage TLB after VCPU migration for Andes cores
Most implementations cache the combined result of two-stage translation,
but some, like Andes cores, use split TLBs that store VS-stage and
G-stage entries separately.
On such systems, when a VCPU migrates to another CPU, an additional
HFENCE.VVMA is required to avoid using stale VS-stage entries, which
could otherwise cause guest faults.
Introduce a static key to identify CPUs with split two-stage TLBs.
When enabled, KVM issues an extra HFENCE.VVMA on VCPU migration to
prevent stale VS-stage mappings.
Signed-off-by: Hui Min Mina Chou <minachou@andestech.com>
Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
Reviewed-by: Radim Krčmář <rkrcmar@ventanamicro.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Link: https://lore.kernel.org/r/20251117084555.157642-1-minachou@andestech.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'tools/testing/selftests/kvm/include/kvm_util.h')
0 files changed, 0 insertions, 0 deletions