Revision 92067bf4 target-i386/cpu.c
b/target-i386/cpu.c | ||
---|---|---|
35 | 35 |
#include "qapi/visitor.h" |
36 | 36 |
#include "sysemu/arch_init.h" |
37 | 37 |
|
38 |
#include "hyperv.h" |
|
39 |
|
|
40 | 38 |
#include "hw/hw.h" |
41 | 39 |
#if defined(CONFIG_KVM) |
42 | 40 |
#include <linux/kvm_para.h> |
... | ... | |
1591 | 1589 |
object_property_parse(OBJECT(cpu), num, "tsc-frequency", errp); |
1592 | 1590 |
} else if (!strcmp(featurestr, "hv-spinlocks")) { |
1593 | 1591 |
char *err; |
1592 |
const int min = 0xFFF; |
|
1594 | 1593 |
numvalue = strtoul(val, &err, 0); |
1595 | 1594 |
if (!*val || *err) { |
1596 | 1595 |
error_setg(errp, "bad numerical value %s", val); |
1597 | 1596 |
goto out; |
1598 | 1597 |
} |
1599 |
hyperv_set_spinlock_retries(numvalue); |
|
1598 |
if (numvalue < min) { |
|
1599 |
fprintf(stderr, "hv-spinlocks value shall always be >= 0x%x" |
|
1600 |
", fixup will be removed in future versions\n", |
|
1601 |
min); |
|
1602 |
numvalue = min; |
|
1603 |
} |
|
1604 |
cpu->hyperv_spinlock_attempts = numvalue; |
|
1600 | 1605 |
} else { |
1601 | 1606 |
error_setg(errp, "unrecognized feature %s", featurestr); |
1602 | 1607 |
goto out; |
... | ... | |
1606 | 1611 |
} else if (!strcmp(featurestr, "enforce")) { |
1607 | 1612 |
check_cpuid = enforce_cpuid = 1; |
1608 | 1613 |
} else if (!strcmp(featurestr, "hv_relaxed")) { |
1609 |
hyperv_enable_relaxed_timing(true);
|
|
1614 |
cpu->hyperv_relaxed_timing = true;
|
|
1610 | 1615 |
} else if (!strcmp(featurestr, "hv_vapic")) { |
1611 |
hyperv_enable_vapic_recommended(true);
|
|
1616 |
cpu->hyperv_vapic = true;
|
|
1612 | 1617 |
} else { |
1613 | 1618 |
error_setg(errp, "feature string `%s' not in format (+feature|" |
1614 | 1619 |
"-feature|feature=xyz)", featurestr); |
... | ... | |
2489 | 2494 |
x86_cpu_get_feature_words, |
2490 | 2495 |
NULL, NULL, (void *)cpu->filtered_features, NULL); |
2491 | 2496 |
|
2497 |
cpu->hyperv_spinlock_attempts = HYPERV_SPINLOCK_NEVER_RETRY; |
|
2492 | 2498 |
env->cpuid_apic_id = x86_cpu_apic_id_from_index(cs->cpu_index); |
2493 | 2499 |
|
2494 | 2500 |
/* init various static tables used in TCG mode */ |
Also available in: Unified diff