Huacai Chen d81d1306d6 KVM: MIPS: Change the definition of kvm type
[ Upstream commit 15e9e35cd1dec2bc138464de6bf8ef828df19235 ]

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
..
2019-01-28 08:13:52 +01:00
2020-06-07 13:18:48 +02:00
2019-07-09 12:11:59 -07:00
2019-05-23 21:07:30 -04:00
2019-03-07 18:32:01 -08:00
2019-01-24 11:11:42 -07:00
2019-09-19 14:22:44 +02:00
2019-09-25 17:51:39 -07:00
2019-08-02 14:44:02 +10:00
2019-09-16 10:18:01 -04:00
2020-05-06 08:15:01 +02:00
2019-02-14 11:51:51 -05:00
2018-12-20 19:13:07 +01:00
2019-03-27 13:30:07 -07:00
2019-09-21 14:26:33 -07:00
2018-06-18 15:11:53 +10:00
2019-08-12 19:33:50 -07:00
2018-09-13 10:46:24 +02:00
2018-09-05 22:27:11 -07:00
2019-09-18 10:43:22 -06:00
2019-09-08 15:37:04 +02:00
2018-07-07 17:41:38 +02:00
2018-08-03 10:03:57 -07:00
2019-08-19 13:04:45 -07:00
2018-04-11 10:28:37 -07:00
2018-12-16 12:15:25 -08:00
2018-12-01 12:38:32 +01:00
2019-05-28 21:37:30 -07:00
2019-09-23 16:10:28 -05:00
2019-10-02 20:32:27 -06:00
2019-01-22 10:21:45 +01:00
2019-07-30 20:34:34 +02:00
2018-03-20 03:17:41 +02:00
2018-04-14 11:59:31 -04:00
2019-05-28 21:37:30 -07:00
2019-11-05 15:50:14 +01:00
2018-04-11 10:28:37 -07:00
2019-09-16 16:26:11 +02:00
2019-02-14 11:51:51 -05:00
2018-09-03 13:29:38 +02:00
2019-09-18 20:17:50 +02:00
2019-08-01 21:49:46 +02:00
2020-06-03 08:21:33 +02:00