diff options
author | Vadim Rozenfeld <vrozenfe@redhat.com> | 2011-12-18 22:48:13 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-01-19 08:32:12 -0200 |
commit | 28f52cc04d341045e810bd487a478fa9ec5f40be (patch) | |
tree | 2e92fa49e8ea688f9013ed5d8b1dd553a95f2d42 /target-i386/cpuid.c | |
parent | 8c4ec5c0269bda18bb777a64b2008088d1c632dc (diff) | |
download | qemu-28f52cc04d341045e810bd487a478fa9ec5f40be.zip qemu-28f52cc04d341045e810bd487a478fa9ec5f40be.tar.gz qemu-28f52cc04d341045e810bd487a478fa9ec5f40be.tar.bz2 |
hyper-v: introduce Hyper-V support infrastructure.
[Jan: fix build with CONFIG_USER_ONLY]
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/cpuid.c')
-rw-r--r-- | target-i386/cpuid.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 91a104b..b9bfeaf 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; |