[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 22/37] target-i386: convert 'hv_vapic' to static pro
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 22/37] target-i386: convert 'hv_vapic' to static property |
Date: |
Mon, 22 Oct 2012 17:03:08 +0200 |
Signed-off-by: Igor Mammedov <address@hidden>
---
target-i386/cpu.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 029f28c..44cbf9c 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -209,6 +209,34 @@ PropertyInfo qdev_prop_hv_relaxed = {
#define DEFINE_PROP_HV_RELAXED(_n)
\
DEFINE_ABSTRACT_PROP(_n, qdev_prop_hv_relaxed)
+static void x86_get_hv_vapic(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ bool value = hyperv_vapic_recommended();
+
+ visit_type_bool(v, &value, name, errp);
+}
+
+static void x86_set_hv_vapic(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ bool value;
+
+ visit_type_bool(v, &value, name, errp);
+ if (error_is_set(errp)) {
+ return;
+ }
+ hyperv_enable_vapic_recommended(value);
+}
+
+PropertyInfo qdev_prop_hv_vapic = {
+ .name = "boolean",
+ .get = x86_get_hv_vapic,
+ .set = x86_set_hv_vapic,
+};
+#define DEFINE_PROP_HV_VAPIC(_n)
\
+ DEFINE_ABSTRACT_PROP(_n, qdev_prop_hv_vapic)
+
static Property cpu_x86_properties[] = {
DEFINE_PROP_BIT("f-fpu", X86CPU, env.cpuid_features, 0, false),
DEFINE_PROP_BIT("f-vme", X86CPU, env.cpuid_features, 1, false),
@@ -325,6 +353,7 @@ static Property cpu_x86_properties[] = {
DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, 0),
DEFINE_PROP_HV_SPINLOCKS("hv_spinlocks"),
DEFINE_PROP_HV_RELAXED("hv_relaxed"),
+ DEFINE_PROP_HV_VAPIC("hv_vapic"),
DEFINE_PROP_END_OF_LIST(),
};
--
1.7.11.7
- Re: [Qemu-devel] [PATCH 36/37] target-i386: use static properties to list CPUID features, (continued)
- [Qemu-devel] [PATCH 37/37] target-i386: cleanup cpu_x86_find_by_name(), only fill x86_def_t in it, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 26/37] target-i386: convert "vendor" property to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 30/37] target-i386: convert "model" to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 24/37] target-i386: use define for cpuid vendor string size, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 09/37] qdev: export qdev_prop_find() and allow it to be used with DeviceClass instead of Object, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 27/37] target-i386: convert "tsc-frequency" to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 15/37] target-i386: set default value of "hypervisor" feature using static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 22/37] target-i386: convert 'hv_vapic' to static property,
Igor Mammedov <=
- [Qemu-devel] [PATCH 05/37] target-i386: move out CPU features initialization in separate func, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 32/37] target-i386: use static properties for setting cpuid features, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 29/37] target-i386: convert "stepping" to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 12/37] target-i386: convert "xlevel" to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 17/37] target-i386: make 'f-kvmclock' compatible with legacy behaviour, Igor Mammedov, 2012/10/22