RE: [PATCH] KVM: tsc deadline timer works only when hrtimer highresolution configured

From: Liu, Jinsong
Date: Fri Sep 07 2012 - 08:07:29 EST


Avi Kivity wrote:
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 148ed66..0e64997 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -2210,7 +2210,11 @@ int kvm_dev_ioctl_check_extension(long ext)
>> r = kvm_has_tsc_control; break;
>> case KVM_CAP_TSC_DEADLINE_TIMER:
>> +#ifdef CONFIG_HIGH_RES_TIMERS
>> r = boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER); +#else
>> + r = 0;
>> +#endif
>> break;
>
> I prefer a patch making kvm for x86 depend on hrtimers. kvm already
> provides a high resolution timer to the guest in the local apic,
> backing it with the jiffies event source will likely cause some
> guests to malfunction.

Yep, I did a draft test for kvm lapic timer, it also worked fail when CONFIG_HIGH_RES_TIMERS disabled.

Attached is the udpated patch.

Thanks,
Jinsong

====================