From 28f52cc04d341045e810bd487a478fa9ec5f40be Mon Sep 17 00:00:00 2001 From: Vadim Rozenfeld Date: Sun, 18 Dec 2011 22:48:13 +0200 Subject: hyper-v: introduce Hyper-V support infrastructure. [Jan: fix build with CONFIG_USER_ONLY] Signed-off-by: Marcelo Tosatti --- target-i386/cpuid.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'target-i386/cpuid.c') diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 91a104ba0b..b9bfeaff70 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -27,6 +27,8 @@ #include "qemu-option.h" #include "qemu-config.h" +#include "hyperv.h" + /* feature flags taken from "Intel Processor Identification and the CPUID * Instruction" and AMD's "CPUID Specification". In cases of disagreement * between feature naming conventions, aliases may be added. @@ -716,6 +718,14 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) goto error; } x86_cpu_def->tsc_khz = tsc_freq / 1000; + } else if (!strcmp(featurestr, "hv_spinlocks")) { + char *err; + numvalue = strtoul(val, &err, 0); + if (!*val || *err) { + fprintf(stderr, "bad numerical value %s\n", val); + goto error; + } + hyperv_set_spinlock_retries(numvalue); } else { fprintf(stderr, "unrecognized feature %s\n", featurestr); goto error; @@ -724,6 +734,10 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) check_cpuid = 1; } else if (!strcmp(featurestr, "enforce")) { check_cpuid = enforce_cpuid = 1; + } else if (!strcmp(featurestr, "hv_relaxed")) { + hyperv_enable_relaxed_timing(true); + } else if (!strcmp(featurestr, "hv_vapic")) { + hyperv_enable_vapic_recommended(true); } else { fprintf(stderr, "feature string `%s' not in format (+feature|-feature|feature=xyz)\n", featurestr); goto error; -- cgit 1.4.1