qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <zltjiangshi@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>
Cc: Huacai Chen <chenhuacai@gmail.com>,
	Huacai Chen <chenhc@lemote.com>,
	Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>,
	qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [PATCH V2 for-5.2] hw/null-machine: Add the kvm_type() hook for MIPS
Date: Mon, 24 Aug 2020 16:11:08 +0800	[thread overview]
Message-ID: <1598256668-12131-1-git-send-email-chenhc@lemote.com> (raw)

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



             reply	other threads:[~2020-08-24  8:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24  8:11 Huacai Chen [this message]
2020-09-02 13:55 ` [PATCH V2 for-5.2] hw/null-machine: Add the kvm_type() hook for MIPS 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1598256668-12131-1-git-send-email-chenhc@lemote.com \
    --to=zltjiangshi@gmail.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhc@lemote.com \
    --cc=chenhuacai@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).