linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
@ 2012-09-04 15:07 Liu, Jinsong
  2012-09-06 13:58 ` Avi Kivity
  0 siblings, 1 reply; 8+ messages in thread
From: Liu, Jinsong @ 2012-09-04 15:07 UTC (permalink / raw)
  To: Marcelo Tosatti, Avi Kivity, kvm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

>From 728a17e2de591b557c3c8ba31076b4bf2ca5ab42 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Wed, 5 Sep 2012 03:18:15 +0800
Subject: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured

This is for 2 reasons:
1. it's pointless to enable tsc deadline timer to guest when kernel hrtimer
not configured as high resolution, since that would be un-precise based on wheel;
2. tsc deadline timer based on hrtimer, setting a leftmost node to rb tree
and then do hrtimer reprogram. If hrtimer not configured as high resolution,
hrtimer_enqueue_reprogram do nothing and would make tsc deadline timer fail.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/kvm/x86.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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;
 	default:
 		r = 0;
-- 
1.7.1

[-- Attachment #2: 0001-KVM-tsc-deadline-timer-works-only-when-hrtimer-high-.patch --]
[-- Type: application/octet-stream, Size: 1218 bytes --]

From 728a17e2de591b557c3c8ba31076b4bf2ca5ab42 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Wed, 5 Sep 2012 03:18:15 +0800
Subject: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured

This is for 2 reasons:
1. it's pointless to enable tsc deadline timer to guest when kernel hrtimer
not configured as high resolution, since that would be un-precise based on wheel;
2. tsc deadline timer based on hrtimer, setting a leftmost node to rb tree
and then do hrtimer reprogram. If hrtimer not configured as high resolution,
hrtimer_enqueue_reprogram do nothing and would make tsc deadline timer fail.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/kvm/x86.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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;
 	default:
 		r = 0;
-- 
1.7.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-04 15:07 [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured Liu, Jinsong
@ 2012-09-06 13:58 ` Avi Kivity
  2012-09-07 12:07   ` Liu, Jinsong
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2012-09-06 13:58 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: Marcelo Tosatti, kvm, linux-kernel

On 09/04/2012 06:07 PM, Liu, Jinsong wrote:
> From 728a17e2de591b557c3c8ba31076b4bf2ca5ab42 Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Wed, 5 Sep 2012 03:18:15 +0800
> Subject: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
> 
> This is for 2 reasons:
> 1. it's pointless to enable tsc deadline timer to guest when kernel hrtimer
> not configured as high resolution, since that would be un-precise based on wheel;
> 2. tsc deadline timer based on hrtimer, setting a leftmost node to rb tree
> and then do hrtimer reprogram. If hrtimer not configured as high resolution,
> hrtimer_enqueue_reprogram do nothing and would make tsc deadline timer fail.
> 
> 
> 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.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-06 13:58 ` Avi Kivity
@ 2012-09-07 12:07   ` Liu, Jinsong
  2012-09-09 14:28     ` Avi Kivity
  0 siblings, 1 reply; 8+ messages in thread
From: Liu, Jinsong @ 2012-09-07 12:07 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, kvm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2409 bytes --]

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

====================
>From 64d0458ec50a7d6917adf1e9735ba6e6ae6024ad Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Sat, 8 Sep 2012 03:32:31 +0800
Subject: [PATCH] KVM: select HIGH_RES_TIMERS when KVM enabled

This is for 2 reasons:
1. it's pointless for kvm lapic timer and tsc deadline timer
when kernel hrtimer not configured as high resolution, since
that would be not accurate based on wheel;
2. kvm lapic timer and tsc deadline timer based on hrtimer,
setting a leftmost node to rb tree and then do hrtimer reprogram.
If hrtimer not configured as high resolution, hrtimer_enqueue_reprogram
do nothing and then make kvm lapic timer and tsc deadline timer fail.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/kvm/Kconfig |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index a28f338..5f861ca 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -24,6 +24,8 @@ config KVM
 	depends on PCI
 	# for TASKSTATS/TASK_DELAY_ACCT:
 	depends on NET
+	# for HIGH_RES_TIMERS
+	depends on !ARCH_USES_GETTIMEOFFSET
 	select PREEMPT_NOTIFIERS
 	select MMU_NOTIFIER
 	select ANON_INODES
@@ -37,6 +39,8 @@ config KVM
 	select TASK_DELAY_ACCT
 	select PERF_EVENTS
 	select HAVE_KVM_MSI
+	select GENERIC_CLOCKEVENTS
+	select HIGH_RES_TIMERS
 	---help---
 	  Support hosting fully virtualized guest machines using hardware
 	  virtualization extensions.  You will need a fairly recent
-- 
1.7.1

[-- Attachment #2: 0001-KVM-select-HIGH_RES_TIMERS-when-KVM-enabled.patch --]
[-- Type: application/octet-stream, Size: 1488 bytes --]

From 64d0458ec50a7d6917adf1e9735ba6e6ae6024ad Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Sat, 8 Sep 2012 03:32:31 +0800
Subject: [PATCH] KVM: select HIGH_RES_TIMERS when KVM enabled

This is for 2 reasons:
1. it's pointless for kvm lapic timer and tsc deadline timer
when kernel hrtimer not configured as high resolution, since
that would be not accurate based on wheel;
2. kvm lapic timer and tsc deadline timer based on hrtimer,
setting a leftmost node to rb tree and then do hrtimer reprogram.
If hrtimer not configured as high resolution, hrtimer_enqueue_reprogram
do nothing and then make kvm lapic timer and tsc deadline timer fail.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/kvm/Kconfig |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index a28f338..5f861ca 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -24,6 +24,8 @@ config KVM
 	depends on PCI
 	# for TASKSTATS/TASK_DELAY_ACCT:
 	depends on NET
+	# for HIGH_RES_TIMERS
+	depends on !ARCH_USES_GETTIMEOFFSET
 	select PREEMPT_NOTIFIERS
 	select MMU_NOTIFIER
 	select ANON_INODES
@@ -37,6 +39,8 @@ config KVM
 	select TASK_DELAY_ACCT
 	select PERF_EVENTS
 	select HAVE_KVM_MSI
+	select GENERIC_CLOCKEVENTS
+	select HIGH_RES_TIMERS
 	---help---
 	  Support hosting fully virtualized guest machines using hardware
 	  virtualization extensions.  You will need a fairly recent
-- 
1.7.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-07 12:07   ` Liu, Jinsong
@ 2012-09-09 14:28     ` Avi Kivity
  2012-09-09 14:54       ` Liu, Jinsong
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2012-09-09 14:28 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: Marcelo Tosatti, kvm, linux-kernel

On 09/07/2012 03:07 PM, Liu, Jinsong wrote:
> 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
> 
> ====================
> From 64d0458ec50a7d6917adf1e9735ba6e6ae6024ad Mon Sep 17 00:00:00 2001
> From: Liu, Jinsong <jinsong.liu@intel.com>
> Date: Sat, 8 Sep 2012 03:32:31 +0800
> Subject: [PATCH] KVM: select HIGH_RES_TIMERS when KVM enabled
> 
> This is for 2 reasons:
> 1. it's pointless for kvm lapic timer and tsc deadline timer
> when kernel hrtimer not configured as high resolution, since
> that would be not accurate based on wheel;
> 2. kvm lapic timer and tsc deadline timer based on hrtimer,
> setting a leftmost node to rb tree and then do hrtimer reprogram.
> If hrtimer not configured as high resolution, hrtimer_enqueue_reprogram
> do nothing and then make kvm lapic timer and tsc deadline timer fail.
> 
> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
> ---
>  arch/x86/kvm/Kconfig |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
> index a28f338..5f861ca 100644
> --- a/arch/x86/kvm/Kconfig
> +++ b/arch/x86/kvm/Kconfig
> @@ -24,6 +24,8 @@ config KVM
>  	depends on PCI
>  	# for TASKSTATS/TASK_DELAY_ACCT:
>  	depends on NET
> +	# for HIGH_RES_TIMERS
> +	depends on !ARCH_USES_GETTIMEOFFSET
>  	select PREEMPT_NOTIFIERS
>  	select MMU_NOTIFIER
>  	select ANON_INODES
> @@ -37,6 +39,8 @@ config KVM
>  	select TASK_DELAY_ACCT
>  	select PERF_EVENTS
>  	select HAVE_KVM_MSI
> +	select GENERIC_CLOCKEVENTS
> +	select HIGH_RES_TIMERS

hrtimers is an intrusive feature, I don't think we should force-enable
it.  Please change it to a depends on.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-09 14:28     ` Avi Kivity
@ 2012-09-09 14:54       ` Liu, Jinsong
  2012-09-09 14:59         ` Avi Kivity
  0 siblings, 1 reply; 8+ messages in thread
From: Liu, Jinsong @ 2012-09-09 14:54 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, kvm, linux-kernel

Avi Kivity wrote:
> On 09/07/2012 03:07 PM, Liu, Jinsong wrote:
>> 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
>> 
>> ====================
>> From 64d0458ec50a7d6917adf1e9735ba6e6ae6024ad Mon Sep 17 00:00:00
>> 2001 
>> From: Liu, Jinsong <jinsong.liu@intel.com>
>> Date: Sat, 8 Sep 2012 03:32:31 +0800
>> Subject: [PATCH] KVM: select HIGH_RES_TIMERS when KVM enabled
>> 
>> This is for 2 reasons:
>> 1. it's pointless for kvm lapic timer and tsc deadline timer
>> when kernel hrtimer not configured as high resolution, since
>> that would be not accurate based on wheel;
>> 2. kvm lapic timer and tsc deadline timer based on hrtimer,
>> setting a leftmost node to rb tree and then do hrtimer reprogram.
>> If hrtimer not configured as high resolution,
>> hrtimer_enqueue_reprogram 
>> do nothing and then make kvm lapic timer and tsc deadline timer fail.
>> 
>> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> ---
>>  arch/x86/kvm/Kconfig |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>> 
>> diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
>> index a28f338..5f861ca 100644
>> --- a/arch/x86/kvm/Kconfig
>> +++ b/arch/x86/kvm/Kconfig
>> @@ -24,6 +24,8 @@ config KVM
>>  	depends on PCI
>>  	# for TASKSTATS/TASK_DELAY_ACCT:
>>  	depends on NET
>> +	# for HIGH_RES_TIMERS
>> +	depends on !ARCH_USES_GETTIMEOFFSET
>>  	select PREEMPT_NOTIFIERS
>>  	select MMU_NOTIFIER
>>  	select ANON_INODES
>> @@ -37,6 +39,8 @@ config KVM
>>  	select TASK_DELAY_ACCT
>>  	select PERF_EVENTS
>>  	select HAVE_KVM_MSI
>> +	select GENERIC_CLOCKEVENTS
>> +	select HIGH_RES_TIMERS
> 
> hrtimers is an intrusive feature, I don't think we should force-enable
> it.  Please change it to a depends on.

Hmm, if it changed as
config KVM
	depends on HIGH_RES_TIMERS
The item 'Kernel-based Virtual Machine (KVM) support (NEW)' even didn't appear to user when make menuconfig (when HIGH_RES_TIMERS disable)

Is it good? I just have a little concern here:)

Thanks,
Jinsong

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-09 14:54       ` Liu, Jinsong
@ 2012-09-09 14:59         ` Avi Kivity
  2012-09-09 15:10           ` Liu, Jinsong
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2012-09-09 14:59 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: Marcelo Tosatti, kvm, linux-kernel

On 09/09/2012 05:54 PM, Liu, Jinsong wrote:
>> 
>> hrtimers is an intrusive feature, I don't think we should force-enable
>> it.  Please change it to a depends on.
> 
> Hmm, if it changed as
> config KVM
> 	depends on HIGH_RES_TIMERS
> The item 'Kernel-based Virtual Machine (KVM) support (NEW)' even didn't appear to user when make menuconfig (when HIGH_RES_TIMERS disable)
> 
> Is it good? I just have a little concern here:)

It's not good, but that's what we have.

It's okay to force-enable low-impact features (like preempt notifies).

hrimers, on the other hand, change kernel behaviour quite deeply.

Maybe over time someone will fix the config tools to unhide features
that can be enabled by turning on a dependency.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-09 14:59         ` Avi Kivity
@ 2012-09-09 15:10           ` Liu, Jinsong
  2012-09-10  8:10             ` Avi Kivity
  0 siblings, 1 reply; 8+ messages in thread
From: Liu, Jinsong @ 2012-09-09 15:10 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, kvm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

Avi Kivity wrote:
> On 09/09/2012 05:54 PM, Liu, Jinsong wrote:
>>> 
>>> hrtimers is an intrusive feature, I don't think we should
>>> force-enable it.  Please change it to a depends on.
>> 
>> Hmm, if it changed as
>> config KVM
>> 	depends on HIGH_RES_TIMERS
>> The item 'Kernel-based Virtual Machine (KVM) support (NEW)' even
>> didn't appear to user when make menuconfig (when HIGH_RES_TIMERS
>> disable)  
>> 
>> Is it good? I just have a little concern here:)
> 
> It's not good, but that's what we have.
> 
> It's okay to force-enable low-impact features (like preempt notifies).
> 
> hrimers, on the other hand, change kernel behaviour quite deeply.
> 
> Maybe over time someone will fix the config tools to unhide features
> that can be enabled by turning on a dependency.

OK, updated as attached.

Thanks,
Jinsong

===============
>From e6c2a80d3111cc6fb992d78b242619706d99bc6b Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Mon, 10 Sep 2012 06:55:39 +0800
Subject: [PATCH] KVM: KVM enable depends on HIGH_RES_TIMERS

KVM lapic timer and tsc deadline timer based on hrtimer,
setting a leftmost node to rb tree and then do hrtimer reprogram.
If hrtimer not configured as high resolution, hrtimer_enqueue_reprogram
do nothing and then make kvm lapic timer and tsc deadline timer fail.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/kvm/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index a28f338..65657ec 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -20,6 +20,7 @@ if VIRTUALIZATION
 config KVM
 	tristate "Kernel-based Virtual Machine (KVM) support"
 	depends on HAVE_KVM
+	depends on HIGH_RES_TIMERS
 	# for device assignment:
 	depends on PCI
 	# for TASKSTATS/TASK_DELAY_ACCT:
-- 
1.7.1

[-- Attachment #2: 0001-KVM-KVM-enable-depends-on-HIGH_RES_TIMERS.patch --]
[-- Type: application/octet-stream, Size: 1003 bytes --]

From e6c2a80d3111cc6fb992d78b242619706d99bc6b Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Mon, 10 Sep 2012 06:55:39 +0800
Subject: [PATCH] KVM: KVM enable depends on HIGH_RES_TIMERS

KVM lapic timer and tsc deadline timer based on hrtimer,
setting a leftmost node to rb tree and then do hrtimer reprogram.
If hrtimer not configured as high resolution, hrtimer_enqueue_reprogram
do nothing and then make kvm lapic timer and tsc deadline timer fail.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 arch/x86/kvm/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index a28f338..65657ec 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -20,6 +20,7 @@ if VIRTUALIZATION
 config KVM
 	tristate "Kernel-based Virtual Machine (KVM) support"
 	depends on HAVE_KVM
+	depends on HIGH_RES_TIMERS
 	# for device assignment:
 	depends on PCI
 	# for TASKSTATS/TASK_DELAY_ACCT:
-- 
1.7.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured
  2012-09-09 15:10           ` Liu, Jinsong
@ 2012-09-10  8:10             ` Avi Kivity
  0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2012-09-10  8:10 UTC (permalink / raw)
  To: Liu, Jinsong; +Cc: Marcelo Tosatti, kvm, linux-kernel

On 09/09/2012 06:10 PM, Liu, Jinsong wrote:
> Avi Kivity wrote:
>> On 09/09/2012 05:54 PM, Liu, Jinsong wrote:
>>>> 
>>>> hrtimers is an intrusive feature, I don't think we should
>>>> force-enable it.  Please change it to a depends on.
>>> 
>>> Hmm, if it changed as
>>> config KVM
>>> 	depends on HIGH_RES_TIMERS
>>> The item 'Kernel-based Virtual Machine (KVM) support (NEW)' even
>>> didn't appear to user when make menuconfig (when HIGH_RES_TIMERS
>>> disable)  
>>> 
>>> Is it good? I just have a little concern here:)
>> 
>> It's not good, but that's what we have.
>> 
>> It's okay to force-enable low-impact features (like preempt notifies).
>> 
>> hrimers, on the other hand, change kernel behaviour quite deeply.
>> 
>> Maybe over time someone will fix the config tools to unhide features
>> that can be enabled by turning on a dependency.
> 
> OK, updated as attached.

Thanks, applied.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-10  8:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04 15:07 [PATCH] KVM: tsc deadline timer works only when hrtimer high resolution configured Liu, Jinsong
2012-09-06 13:58 ` Avi Kivity
2012-09-07 12:07   ` Liu, Jinsong
2012-09-09 14:28     ` Avi Kivity
2012-09-09 14:54       ` Liu, Jinsong
2012-09-09 14:59         ` Avi Kivity
2012-09-09 15:10           ` Liu, Jinsong
2012-09-10  8:10             ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).