From: Joao Martins <joao.m.martins@oracle.com>
Introduce support for emulating CPUID for Xen HVM guests. It doesn't make
sense to advertise the KVM leaves to a Xen guest, so do it unconditionally
when the xen-version machine property is set.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Obtain xen_version from machine property, make it automatic]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
target/i386/cpu.c | 1 +
target/i386/cpu.h | 2 +
target/i386/kvm/kvm.c | 78 +++++++++++++++++++++++++++++++++++++--
target/i386/kvm/xen-emu.c | 4 +-
target/i386/kvm/xen-emu.h | 13 ++++++-
5 files changed, 91 insertions(+), 7 deletions(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index a98995d4d7..5977edb1ca 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -22,6 +22,7 @@
#include <linux/kvm.h>
#include "standard-headers/asm-x86/kvm_para.h"
+#include "standard-headers/xen/arch-x86/cpuid.h"
#include "cpu.h"
#include "host-cpu.h"
@@ -1750,7 +1751,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
int max_nested_state_len;
int r;
Error *local_err = NULL;
-
memset(&cpuid_data, 0, sizeof(cpuid_data));