x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution
Subsystems (2)
PATCH 1/1 x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution
From: Vivek yadav <[email protected]>
By design, alternative clock sources listed are based on the resolution of current clock source. Once you set a high resolution clock, only high resolution sources are returned.
Mark Hyper-V clock source as a high resolution clock source.
--- arch/x86/kernel/cpu/mshyperv.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +2 -1
@@ -151,7 +151,8 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), - .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .flags = CLOCK_SOURCE_IS_CONTINUOUS | + CLOCK_SOURCE_VALID_FOR_HRES, };static void __init ms_hyperv_init_platform (void )
Signature · 1 line
1.7.4.1
Quoted 18 lines · K. Y. Srinivasan
From: Vivek yadav <[email protected]>
By design, alternative clock sources listed are based on the resolution of current clock source. Once you set a high resolution clock, only high resolution sources are returned.
Mark Hyper-V clock source as a high resolution clock source.Signed-off-by Vivek yadav <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>--- arch/x86/kernel/cpu/mshyperv.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/x86/kernel/cpu/mshyperv.c +0
-0
arch/x86/kernel/cpu/mshyperv.c static struct clocksource hyperv_cs = { · line 155
Quoted 6 lines
arch/x86/kernel/cpu/mshyperv.c +2
-1@@ -151,7 +151,8 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), - .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .flags =CLOCK_SOURCE_IS_CONTINUOUS | + CLOCK_SOURCE_VALID_FOR_HRES,
No, this is wrong. The CLOCK_SOURCE_VALID_FOR_HRES flag is managed by the core code and set when a clocksource fulfils the criteria.
The changelog above is not explaining what problem you are trying to solve.
Thanks,
tglx
Quoted 42 lines
-----Original Message-----
From: Thomas Gleixner [mailto:[email protected]]
Sent: Saturday, July 4, 2015 1:11 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Vivek Yadav
Subject: Re: [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as being high resolutionQuoted 7 lines · K. Y. Srinivasan
From: Vivek yadav <[email protected]>
By design, alternative clock sources listed are based on the resolution of current clock source. Once you set a high resolution clock, only high resolution sources are returned.
Mark Hyper-V clock source as a high resolution clock source.Review
Quoted 7 lines
Signed-off-by Vivek yadav <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>--- arch/x86/kernel/cpu/mshyperv.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/arch/x86/kernel/cpu/mshyperv.carch/x86/kernel/cpu/mshyperv.c static struct clocksource hyperv_cs = { · line 155
Quoted 10 lines
index 9b5d7b5..0e507a0 100644
arch/x86/kernel/cpu/mshyperv.c +2
-1@@ -151,7 +151,8 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), - .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .flags =CLOCK_SOURCE_IS_CONTINUOUS | + CLOCK_SOURCE_VALID_FOR_HRES,No, this is wrong. The
CLOCK_SOURCE_VALID_FOR_HRESflag is managed by the core code and set when a clocksource fulfils the criteria.
Quoted 3 lines
The changelog above is not explaining what problem you are trying to solve.
I think the problem Vivek was trying to solve is that after the Hyper-V clocxk was installed, if the user switched to another clocksource, say tsc, the hyper-V clock source would not listed. I will investigate this further and let you know. Thanks for the feedback.
Regards,
K. Y
Quoted 3 lines
tglx