kernel_optimize_test/arch/x86/kvm
Jan Kiszka 4d25a066b6 KVM: Don't automatically expose the TSC deadline timer in cpuid
Unlike all of the other cpuid bits, the TSC deadline timer bit is set
unconditionally, regardless of what userspace wants.

This is broken in several ways:
 - if userspace doesn't use KVM_CREATE_IRQCHIP, and doesn't emulate the TSC
   deadline timer feature, a guest that uses the feature will break
 - live migration to older host kernels that don't support the TSC deadline
   timer will cause the feature to be pulled from under the guest's feet;
   breaking it
 - guests that are broken wrt the feature will fail.

Fix by not enabling the feature automatically; instead report it to userspace.
Because the feature depends on KVM_CREATE_IRQCHIP, which we cannot guarantee
will be called, we expose it via a KVM_CAP_TSC_DEADLINE_TIMER and not
KVM_GET_SUPPORTED_CPUID.

Fixes the Illumos guest kernel, which uses the TSC deadline timer feature.

[avi: add the KVM_CAP + documentation]

Reported-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Tested-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-26 13:27:44 +02:00
..
emulate.c KVM: x86 emulator: convert push %sreg/pop %sreg to direct decode 2011-09-25 19:52:58 +03:00
i8254.c KVM: x86: Prevent starting PIT timers in the absence of irqchip support 2011-12-25 17:13:18 +02:00
i8254.h
i8259.c KVM: Clean up and extend rate-limited output 2011-09-25 19:52:43 +03:00
irq.c
irq.h
Kconfig
kvm_cache_regs.h
kvm_timer.h KVM: emulate lapic tsc deadline timer for guest 2011-10-05 15:34:56 +02:00
lapic.c KVM: emulate lapic tsc deadline timer for guest 2011-10-05 15:34:56 +02:00
lapic.h KVM: emulate lapic tsc deadline timer for guest 2011-10-05 15:34:56 +02:00
Makefile
mmu_audit.c KVM: Clean up and extend rate-limited output 2011-09-25 19:52:43 +03:00
mmu.c
mmu.h
mmutrace.h
paging_tmpl.h
svm.c KVM: SVM: Keep intercepting task switching with NPT enabled 2011-10-30 12:24:10 +02:00
timer.c
trace.h
tss.h
vmx.c KVM: VMX: Check for automatic switch msr table overflow 2011-11-17 16:28:09 +02:00
x86.c KVM: Don't automatically expose the TSC deadline timer in cpuid 2011-12-26 13:27:44 +02:00
x86.h