RE: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-26 Thread Dexuan Cui
> From: Daniel Lezcano 
> Sent: Thursday, September 26, 2019 6:17 AM
> >>
> >> I can take this patch if needed.
> >
> > Thanks, Daniel! Usually tglx takes care of the patches, but it looks 
> > recently he
> > may be too busy to handle the 3 patches.
> >
> > I guess you can take the patch, if tglx has no objection. :-)
> > If you take the patch, please take all the 3 patches.
> 
> I maintain drivers/clocksource for the tip/timers/core branch. I don't
> want to proxy another tip branch as it is out of my jurisdiction.

I see. Thanks for the explanation! I learned more about the tip tree. :-)

> So I can take patch 3/3 but will let the other 2 patches to be picked by
> the right person. It is your call.

Sounds good. Daniel, then please take this patch, e.g. patch 3/3.

Patch 2/3 may as well go through Sasha's hyper-v tree, since it's required by
other changes to the drivers hv_balloon, hv_utils and hv_vmbus.

I suppose tglx is the best person to take patch 1/3, but if he's too busy to
handle it, it can also go through the hyper-v tree, since the related other
patches have been in the mainline now.

Thanks,
-- Dexuan


Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-26 Thread Daniel Lezcano
On 26/09/2019 01:35, Dexuan Cui wrote:
>> From: Daniel Lezcano 
>> Sent: Wednesday, September 25, 2019 4:21 PM
>> To: Dexuan Cui ; a...@arndb.de; b...@alien8.de;
>> Haiyang Zhang ; h...@zytor.com; KY Srinivasan
>> ; linux-hyp...@vger.kernel.org;
>> linux-kernel@vger.kernel.org; mi...@redhat.com; sas...@kernel.org; Stephen
>> Hemminger ; t...@linutronix.de; x...@kernel.org;
>> Michael Kelley ; Sasha Levin
>> 
>> Cc: linux-a...@vger.kernel.org
>> Subject: Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V
>> clocksource for hibernation
>>
>> On 06/09/2019 00:47, Dexuan Cui wrote:
>>> This is needed for hibernation, e.g. when we resume the old kernel, we need
>>> to disable the "current" kernel's TSC page and then resume the old kernel's.
>>>
>>> Signed-off-by: Dexuan Cui 
>>> Reviewed-by: Michael Kelley 
>>
>> I can take this patch if needed.
> 
> Thanks, Daniel! Usually tglx takes care of the patches, but it looks recently 
> he
> may be too busy to handle the 3 patches. 
> 
> I guess you can take the patch, if tglx has no objection. :-)
> If you take the patch, please take all the 3 patches.

I maintain drivers/clocksource for the tip/timers/core branch. I don't
want to proxy another tip branch as it is out of my jurisdiction.

So I can take patch 3/3 but will let the other 2 patches to be picked by
the right person. It is your call.



-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog



RE: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-25 Thread Dexuan Cui
> From: Daniel Lezcano 
> Sent: Wednesday, September 25, 2019 4:21 PM
> To: Dexuan Cui ; a...@arndb.de; b...@alien8.de;
> Haiyang Zhang ; h...@zytor.com; KY Srinivasan
> ; linux-hyp...@vger.kernel.org;
> linux-kernel@vger.kernel.org; mi...@redhat.com; sas...@kernel.org; Stephen
> Hemminger ; t...@linutronix.de; x...@kernel.org;
> Michael Kelley ; Sasha Levin
> 
> Cc: linux-a...@vger.kernel.org
> Subject: Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V
> clocksource for hibernation
> 
> On 06/09/2019 00:47, Dexuan Cui wrote:
> > This is needed for hibernation, e.g. when we resume the old kernel, we need
> > to disable the "current" kernel's TSC page and then resume the old kernel's.
> >
> > Signed-off-by: Dexuan Cui 
> > Reviewed-by: Michael Kelley 
> 
> I can take this patch if needed.

Thanks, Daniel! Usually tglx takes care of the patches, but it looks recently he
may be too busy to handle the 3 patches. 

I guess you can take the patch, if tglx has no objection. :-)
If you take the patch, please take all the 3 patches.

Thanks,
-- Dexuan


Re: [PATCH v5 3/3] clocksource/drivers: Suspend/resume Hyper-V clocksource for hibernation

2019-09-25 Thread Daniel Lezcano
On 06/09/2019 00:47, Dexuan Cui wrote:
> This is needed for hibernation, e.g. when we resume the old kernel, we need
> to disable the "current" kernel's TSC page and then resume the old kernel's.
> 
> Signed-off-by: Dexuan Cui 
> Reviewed-by: Michael Kelley 

I can take this patch if needed.

> ---
>  drivers/clocksource/hyperv_timer.c | 25 +
>  1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/clocksource/hyperv_timer.c 
> b/drivers/clocksource/hyperv_timer.c
> index 726a65e..07f4747 100644
> --- a/drivers/clocksource/hyperv_timer.c
> +++ b/drivers/clocksource/hyperv_timer.c
> @@ -237,12 +237,37 @@ static u64 read_hv_sched_clock_tsc(void)
>   return read_hv_clock_tsc(NULL) - hv_sched_clock_offset;
>  }
>  
> +static void suspend_hv_clock_tsc(struct clocksource *arg)
> +{
> + u64 tsc_msr;
> +
> + /* Disable the TSC page */
> + hv_get_reference_tsc(tsc_msr);
> + tsc_msr &= ~BIT_ULL(0);
> + hv_set_reference_tsc(tsc_msr);
> +}
> +
> +
> +static void resume_hv_clock_tsc(struct clocksource *arg)
> +{
> + phys_addr_t phys_addr = virt_to_phys(_pg);
> + u64 tsc_msr;
> +
> + /* Re-enable the TSC page */
> + hv_get_reference_tsc(tsc_msr);
> + tsc_msr &= GENMASK_ULL(11, 0);
> + tsc_msr |= BIT_ULL(0) | (u64)phys_addr;
> + hv_set_reference_tsc(tsc_msr);
> +}
> +
>  static struct clocksource hyperv_cs_tsc = {
>   .name   = "hyperv_clocksource_tsc_page",
>   .rating = 400,
>   .read   = read_hv_clock_tsc,
>   .mask   = CLOCKSOURCE_MASK(64),
>   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
> + .suspend= suspend_hv_clock_tsc,
> + .resume = resume_hv_clock_ts,>  };
>  
>  static u64 notrace read_hv_clock_msr(struct clocksource *arg)
> 


-- 
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog