1
0
Fork 0
alistair23-linux/include/uapi
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
..
asm-generic mm: introduce MADV_PAGEOUT 2019-09-25 17:51:41 -07:00
drm drm/amdgpu: return tcc_disabled_mask to userspace 2019-10-02 12:58:33 -05:00
linux KVM: MIPS: Change the definition of kvm type 2020-09-23 12:40:38 +02:00
misc habanalabs: stop using the acronym KMD 2019-09-05 14:55:27 +03:00
mtd mtd: abi: do not use C++ style comments in uapi header 2019-07-07 20:31:29 +02:00
rdma rdma: Remove nes ABI header 2020-01-17 19:48:39 +01:00
scsi scsi: use __u{8,16,32,64} instead of uint{8,16,32,64}_t in uapi headers 2019-08-12 22:19:27 -04:00
sound Merge branch 'asoc-5.4' into asoc-next 2019-09-09 14:55:20 +01:00
video
xen
Kbuild kbuild: re-implement Makefile.headersinst without recursion 2019-06-15 19:57:02 +09:00