kvmtool: expose the TSC Deadline Timer feature to the guest
PATCH 1/1 kvmtool: expose the TSC Deadline Timer feature to the guest
From: Arjan van de Ven <[email protected]>
with the TSC deadline timer feature, we don't need to calibrate the apic timers anymore, which saves more than 100 milliseconds of boot time.
Signed-off-by Arjan van de Ven <[email protected]>
Signed-off-by Dimitri John Ledkov <[email protected]>
--- x86/cpuid.c | 3 +++ 1 file changed, 3 insertions(+)
x86/cpuid.c +3 -0
@@ -31,6 +31,9 @@ static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid)/* Set X86_FEATURE_HYPERVISOR */ if (entry->index ==0 ) entry->ecx |= (1 <<31 ); +/* Set CPUID_EXT_TSC_DEADLINE_TIMER*/ +if (entry->index ==0 ) + entry->ecx |= (1 <<24 );break ;case 6 :/* Clear X86_FEATURE_EPB */
Signature · 1 line
2.1.4
Hi Dimitri,
Quoted 16 lines · Dimitri John Ledkov
From: Arjan van de Ven <[email protected]>
with the TSC deadline timer feature, we don't need to calibrate the apic timers anymore, which saves more than 100 milliseconds of boot time.
Signed-off-by Arjan van de Ven <[email protected]>Signed-off-by Dimitri John Ledkov <[email protected]>--- x86/cpuid.c | 3 +++ 1 file changed, 3 insertions(+)x86/cpuid.c +0
-0
x86/cpuid.c static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid) · line 36
Quoted 6 lines
x86/cpuid.c +3
-0@@ -31,6 +31,9 @@ static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid)/* Set X86_FEATURE_HYPERVISOR */ if (entry->index ==0 ) entry->ecx |= (1 <<31 ); +/* Set CPUID_EXT_TSC_DEADLINE_TIMER*/ +if (entry->index ==0 ) + entry->ecx |= (1 <<24 );
This can only be enabled if the kernel supports emulation of that feature (reported via KVM_CAP_TSC_DEADLINE_TIMER)
(cf: Documentation/virtual/kvm/api.txt and respective QEMU code in target-i386/kvm.c)
Cheers,
Andre.
Quoted 4 lines
x86/cpuid.c +0
-0break ;case 6 :/* Clear X86_FEATURE_EPB */