From: Joao Martins <joao.m.martins@oracle.com>
Introduce support for emulating CPUID for Xen HVM guests via
xen, xen_vapic as changeable params.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Obtain xen_version from machine property]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
target/i386/cpu.c | 2 ++
target/i386/cpu.h | 3 ++
target/i386/kvm/kvm.c | 72 +++++++++++++++++++++++++++++++++++++++++++
target/i386/xen.h | 8 +++++
4 files changed, 85 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 22b681ca37..45aa9e40a5 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -7069,6 +7069,8 @@ static Property x86_cpu_properties[] = {
* own cache information (see x86_cpu_load_def()).
*/
DEFINE_PROP_BOOL("legacy-cache", X86CPU, legacy_cache, true),
+ DEFINE_PROP_BOOL("xen", X86CPU, xen, false),
/*
* From "Requirements for Implementing the Microsoft
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index d4bc19577a..5ddd14467e 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1964,6 +1964,9 @@ struct ArchCPU {
int32_t thread_id;
int32_t hv_max_vps;
+
+ bool xen;
+ bool xen_vapic;
};