All of lore.kernel.org
 help / color / mirror / Atom feed
From: cov@codeaurora.org (Christopher Covington)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 3/5] clocksource: arch_timer: use virtual counters
Date: Mon, 20 May 2013 15:48:16 -0400	[thread overview]
Message-ID: <519A7E00.7090600@codeaurora.org> (raw)
In-Reply-To: <1368631441-28434-4-git-send-email-mark.rutland@arm.com>

Hi Mark,

On 05/15/2013 11:23 AM, Mark Rutland wrote:

[...]

> Instead, this patch makes us always use the virtual counters. If we're a
> guest, or don't have hyp mode, we'll use the virtual timers, and as such
> don't care about CNTVOFF as long as it doesn't change in such a way as
> to make time travel backwards. If we do have hyp mode, and might be a
> KVM host, we have to use the physical timers, and require CNTVOFF to be
> zero so as to have a consistent view of time between the physical timers
> and virtual counters.

[...]

> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index a2b2541..053d846 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -287,7 +279,7 @@ static int __init arch_timer_register(void)
>  	cyclecounter.mult = clocksource_counter.mult;
>  	cyclecounter.shift = clocksource_counter.shift;
>  	timecounter_init(&timecounter, &cyclecounter,
> -			 arch_counter_get_cntpct());
> +			 arch_counter_get_cntvct());
>  
>  	if (arch_timer_use_virtual) {
>  		ppi = arch_timer_ppi[VIRT_PPI];

[...]


You say "we have to use the physical timers", but then change the code to read
exclusively from the virtual counter. I think it'd make more sense to just say
that CNTVOFF has to be zero (and why exactly?).

Thanks,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.

  reply	other threads:[~2013-05-20 19:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15 15:23 [PATCHv2 0/5] arm: arch_timer cleanups and niceties Mark Rutland
2013-05-15 15:23 ` [PATCHv2 1/5] ARM: hyp: initialize CNTVOFF to zero Mark Rutland
2013-05-15 15:23 ` [PATCHv2 2/5] ARM: KVM: arch_timers: zero CNTVOFF upon return to host Mark Rutland
2013-05-15 15:23 ` [PATCHv2 3/5] clocksource: arch_timer: use virtual counters Mark Rutland
2013-05-20 19:48   ` Christopher Covington [this message]
2013-05-15 15:24 ` [PATCHv2 4/5] arm: fix up ARM_ARCH_TIMER selects Mark Rutland
2013-05-16  0:07   ` Simon Horman
2013-05-15 15:24 ` [PATCHv2 5/5] ARM: arch_timer: stop virtual timer when booted in HYP mode Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519A7E00.7090600@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.