1
0
Fork 0
alistair23-linux/arch/mips/kvm
Huacai Chen d81d1306d6 KVM: MIPS: Change the definition of kvm type
[ Upstream commit 15e9e35cd1 ]

MIPS defines two kvm types:

 #define KVM_VM_MIPS_TE          0
 #define KVM_VM_MIPS_VZ          1

In Documentation/virt/kvm/api.rst it is said that "You probably want to
use 0 as machine type", which implies that type 0 be the "automatic" or
"default" type. And, in user-space libvirt use the null-machine (with
type 0) to detect the kvm capability, which returns "KVM not supported"
on a VZ platform.

I try to fix it in QEMU but it is ugly:
https://lists.nongnu.org/archive/html/qemu-devel/2020-08/msg05629.html

And Thomas Huth suggests me to change the definition of kvm type:
https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03281.html

So I define like this:

 #define KVM_VM_MIPS_AUTO        0
 #define KVM_VM_MIPS_VZ          1
 #define KVM_VM_MIPS_TE          2

Since VZ and TE cannot co-exists, using type 0 on a TE platform will
still return success (so old user-space tools have no problems on new
kernels); the advantage is that using type 0 on a VZ platform will not
return failure. So, the only problem is "new user-space tools use type
2 on old kernels", but if we treat this as a kernel bug, we can backport
this patch to old stable kernels.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Message-Id: <1599734031-28746-1-git-send-email-chenhc@lemote.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-23 12:40:38 +02:00
..
00README.txt KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
Kconfig Make anon_inodes unconditional 2019-04-19 14:03:11 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
commpage.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
commpage.h MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" 2014-06-30 16:52:03 +02:00
dyntrans.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
emulate.c MIPS: Annotate fall-through in kvm/emulate.c 2019-07-18 14:41:04 -07:00
entry.c KVM: MIPS/Entry: Update entry code to support VZ 2017-03-28 14:53:51 +01:00
fpu.S MIPS: KVM: Fix fpu.S misassembly with r6 2016-07-05 16:09:11 +02:00
hypcall.c KVM: MIPS: Implement HYPCALL emulation 2017-03-28 14:53:33 +01:00
interrupt.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
interrupt.h KVM: MIPS: Implement VZ support 2017-03-28 14:53:54 +01:00
mips.c KVM: MIPS: Change the definition of kvm type 2020-09-23 12:40:38 +02:00
mmu.c KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() 2020-08-26 10:41:08 +02:00
msa.S MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
stats.c MIPS: KVM: Clean up kvm_exit trace event 2016-06-14 11:16:23 +02:00
tlb.c KVM: MIPS: Fix maybe-uninitialized build failure 2017-06-20 17:02:48 +02:00
trace.h KVM: MIPS/VZ: Trace guest mode changes 2017-03-28 14:54:00 +01:00
trap_emul.c MIPS: mm: Add set_cpu_context() for ASID assignments 2019-02-04 10:56:33 -08:00
vz.c MIPS: mm: Unify ASID version checks 2019-02-04 10:56:30 -08:00