aboutsummaryrefslogtreecommitdiff
path: root/target/mips/kvm_mips.h
diff options
context:
space:
mode:
authorHuacai Chen <zltjiangshi@gmail.com>2020-06-24 18:45:28 +0800
committerAleksandar Markovic <aleksandar.qemu.devel@gmail.com>2020-06-27 19:35:39 +0200
commit719d109b7fe153b0ec4dfeba2f303f864555d819 (patch)
tree96e5791640ece620ab8b020bb951f2d1769924ca /target/mips/kvm_mips.h
parent553cf5d7c47bee05a3dec9461c1f8430316d516b (diff)
hw/mips: Implement the kvm_type() hook in MachineClass
MIPS has two types of KVM: TE & VZ, and TE is the default type. Now we can't create a VZ guest in QEMU because it lacks the kvm_type() hook in MachineClass. This patch add the the kvm_type() hook to support both of the two types. [AM: Added "if defined" guards.] Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> Signed-off-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> Message-Id: <1592995531-32600-2-git-send-email-chenhc@lemote.com>
Diffstat (limited to 'target/mips/kvm_mips.h')
-rw-r--r--target/mips/kvm_mips.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/target/mips/kvm_mips.h b/target/mips/kvm_mips.h
index 1e4014792d..171d53dbe1 100644
--- a/target/mips/kvm_mips.h
+++ b/target/mips/kvm_mips.h
@@ -12,6 +12,8 @@
#ifndef KVM_MIPS_H
#define KVM_MIPS_H
+#include "cpu.h"
+
/**
* kvm_mips_reset_vcpu:
* @cpu: MIPSCPU
@@ -23,4 +25,13 @@ void kvm_mips_reset_vcpu(MIPSCPU *cpu);
int kvm_mips_set_interrupt(MIPSCPU *cpu, int irq, int level);
int kvm_mips_set_ipi_interrupt(MIPSCPU *cpu, int irq, int level);
+#ifdef CONFIG_KVM
+int mips_kvm_type(MachineState *machine, const char *vm_type);
+#else
+static inline int mips_kvm_type(MachineState *machine, const char *vm_type)
+{
+ return 0;
+}
+#endif
+
#endif /* KVM_MIPS_H */