All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 for-5.2] hw/null-machine: Add the kvm_type() hook for MIPS
@ 2020-08-24  8:11 Huacai Chen
  2020-09-02 13:55 ` Philippe Mathieu-Daudé
  2020-09-08 17:25 ` Thomas Huth
  0 siblings, 2 replies; 11+ messages in thread
From: Huacai Chen @ 2020-08-24  8:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Aleksandar Markovic
  Cc: Huacai Chen, Huacai Chen, Aleksandar Rikalo, qemu-devel, Aurelien Jarno

MIPS has two types of KVM: TE & VZ, and TE is the default type. Now,
libvirt uses a null-machine to detect the kvm capability. In the MIPS
case, it will return "KVM not supported" on a VZ platform by default.
So, add the kvm_type() hook to the null-machine.

This seems not a very good solution, but I cannot do it better now.

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>
---
 hw/core/meson.build    | 2 +-
 hw/core/null-machine.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/core/meson.build b/hw/core/meson.build
index fc91f98..b6591b9 100644
--- a/hw/core/meson.build
+++ b/hw/core/meson.build
@@ -35,7 +35,6 @@ softmmu_ss.add(files(
   'machine-hmp-cmds.c',
   'machine.c',
   'nmi.c',
-  'null-machine.c',
   'qdev-fw.c',
   'qdev-properties-system.c',
   'sysbus.c',
@@ -45,5 +44,6 @@ softmmu_ss.add(files(
 
 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files(
   'machine-qmp-cmds.c',
+  'null-machine.c',
   'numa.c',
 ))
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index 7e69352..4b4ab76 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -17,6 +17,9 @@
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 #include "hw/core/cpu.h"
+#ifdef TARGET_MIPS
+#include "kvm_mips.h"
+#endif
 
 static void machine_none_init(MachineState *mch)
 {
@@ -55,6 +58,9 @@ static void machine_none_machine_init(MachineClass *mc)
     mc->no_floppy = 1;
     mc->no_cdrom = 1;
     mc->no_sdcard = 1;
+#ifdef TARGET_MIPS
+    mc->kvm_type = mips_kvm_type;
+#endif
 }
 
 DEFINE_MACHINE("none", machine_none_machine_init)
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-10  1:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24  8:11 [PATCH V2 for-5.2] hw/null-machine: Add the kvm_type() hook for MIPS Huacai Chen
2020-09-02 13:55 ` Philippe Mathieu-Daudé
2020-09-03  0:58   ` Huacai Chen
2020-09-07  3:39     ` Philippe Mathieu-Daudé
2020-09-08  0:41       ` Huacai Chen
2020-09-08 17:25 ` Thomas Huth
2020-09-08 17:59   ` Eduardo Habkost
2020-09-08 18:12     ` Philippe Mathieu-Daudé
2020-09-09  2:57   ` chen huacai
2020-09-09  7:20     ` Thomas Huth
2020-09-10  1:31       ` Huacai Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.