diff options
author | Huacai Chen <chenhc@lemote.com> | 2020-05-23 09:56:35 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-04 19:49:08 +0200 |
commit | 49bb96003fb19b77a0116d9330bdfd61aa41244b (patch) | |
tree | aea9a36dc7775654b32769411c58b9dc1dc28e49 /arch/mips | |
parent | KVM: MIPS: Use root tlb to control guest's CCA for Loongson-3 (diff) | |
download | linux-49bb96003fb19b77a0116d9330bdfd61aa41244b.tar.xz linux-49bb96003fb19b77a0116d9330bdfd61aa41244b.zip |
KVM: MIPS: Let indexed cacheops cause guest exit on Loongson-3
Loongson-3's indexed cache operations need a node-id in the address,
but in KVM guest the node-id may be incorrect. So, let indexed cache
operations cause guest exit on Loongson-3.
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <1590220602-3547-9-git-send-email-chenhc@lemote.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kvm/vz.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/mips/kvm/vz.c b/arch/mips/kvm/vz.c index 6e62154ed09b..20f69855f164 100644 --- a/arch/mips/kvm/vz.c +++ b/arch/mips/kvm/vz.c @@ -2853,8 +2853,12 @@ static int kvm_vz_hardware_enable(void) write_c0_guestctl0(MIPS_GCTL0_CP0 | (MIPS_GCTL0_AT_GUEST << MIPS_GCTL0_AT_SHIFT) | MIPS_GCTL0_CG | MIPS_GCTL0_CF); - if (cpu_has_guestctl0ext) - set_c0_guestctl0ext(MIPS_GCTL0EXT_CGI); + if (cpu_has_guestctl0ext) { + if (current_cpu_type() != CPU_LOONGSON64) + set_c0_guestctl0ext(MIPS_GCTL0EXT_CGI); + else + clear_c0_guestctl0ext(MIPS_GCTL0EXT_CGI); + } if (cpu_has_guestid) { write_c0_guestctl1(0); |