diff options
author | Liu, Jinsong <jinsong.liu@intel.com> | 2012-07-03 02:35:10 +0800 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-07-03 17:36:32 -0300 |
commit | a75b3e0f641a68b7cdd4bbe4ed1b60f963bf2b62 (patch) | |
tree | 289b00093dcd217b82b37b93aa47a83bd80ba657 /target-i386/kvm.c | |
parent | bfee7546df51c08e395dc8a7676a5c7f20186fee (diff) | |
download | hqemu-a75b3e0f641a68b7cdd4bbe4ed1b60f963bf2b62.zip hqemu-a75b3e0f641a68b7cdd4bbe4ed1b60f963bf2b62.tar.gz |
kvm: expose tsc deadline timer feature to guest
This patch exposes tsc deadline timer feature to guest if
1). in-kernel irqchip is used, and
2). kvm has emulated tsc deadline timer, and
3). user authorize the feature exposing via -cpu or +/- tsc-deadline
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r-- | target-i386/kvm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 0d0d8f6..52b577f 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -361,8 +361,13 @@ int kvm_arch_init_vcpu(CPUX86State *env) env->cpuid_features &= kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX); i = env->cpuid_ext_features & CPUID_EXT_HYPERVISOR; + j = env->cpuid_ext_features & CPUID_EXT_TSC_DEADLINE_TIMER; env->cpuid_ext_features &= kvm_arch_get_supported_cpuid(s, 1, 0, R_ECX); env->cpuid_ext_features |= i; + if (j && kvm_irqchip_in_kernel() && + kvm_check_extension(s, KVM_CAP_TSC_DEADLINE_TIMER)) { + env->cpuid_ext_features |= CPUID_EXT_TSC_DEADLINE_TIMER; + } env->cpuid_ext2_features &= kvm_arch_get_supported_cpuid(s, 0x80000001, 0, R_EDX); |