linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] Add physical count arch timer support for clocksource in ARMv7.
Date: Mon, 16 Sep 2013 09:16:05 +0100	[thread overview]
Message-ID: <5236BE45.1090408@arm.com> (raw)
In-Reply-To: <20130914120557.GB2746@lukather>

Hi Maxime,

On 14/09/13 13:05, maxime.ripard at free-electrons.com wrote:
> Hi Marc, Fan,
> 
> On Fri, Sep 13, 2013 at 10:30:49AM +0100, Marc Zyngier wrote:
>> On 13/09/13 09:49, cinifr wrote:
>>> On 13 September 2013 00:39, Marc Zyngier <marc.zyngier@arm.com>
>>> wrote: I am   wondering   what is the principle between kernel
>>> and bootload? What should be done in bootloader and what should
>>> be done in kernel? As you said, If kernel boot from hyp,
>>> Kernel can set  CNTVOFF to zero directly, does we add the code
>>> to set CNTVOFF in kernel?  But, if kernel boot from PL1 NS=0,
>>> Does kernel  need to switch hyp mode to set  CNTVOFF and return
>>> PL1 NS=0 mode? Or,kernel dont care it because kernel   believe
>>> bootloader have set CNTVOFF  before?
>> 
>> In an ideal world, the bootloader should set CNTVOFF to zero. The
>> fact that the kernel does it too when booted in HYP mode is to
>> preserve itself from from broken bootloaders.
>> 
>> CNTVOFF can only be setup from either HYP or Secure Monitor mode
>> with SCR.NS == 1, so if you run your kernel in secure mode, it is
>> always best to do it in the bootloader.
> 
> What would happen exactly if a kernel expects CNTVOFF to be set to
> 0, and that your bootloader don't set it?

It doesn't really matter if it is set to 0. What actually matters is
that all the CPUs have the same value. Otherwise, you will have time
reported differently depending on the CPU you're looking from.

> From what you're saying, it's will be set by the kernel if it's
> booted in hypervisor mode, but what if it's not?
> 
> The ARM documentation says that the CNTVOFF register will hold an 
> undefined value, how would that affect the kernel?

See above. Without a consistent view of time across CPUs, you're in
deep trouble.

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2013-09-16  8:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  6:51 [PATCH 0/4] Add smp support for Allwinner A20 and phy arch count timer Fan Rong
2013-09-12  6:51 ` [PATCH 1/4] Add smp support for Allwinner A20(sunxi 7i) Fan Rong
2013-09-12 14:26   ` Mark Rutland
2013-09-12 15:53     ` cinifr
2013-09-12 14:40   ` Russell King - ARM Linux
2013-09-12  6:51 ` [PATCH 2/4] Add cpuconfig nodes in dts for smp configure Fan Rong
2013-09-14 11:50   ` Maxime Ripard
2013-09-12  6:51 ` [PATCH 3/4] Add physical count arch timer support for clocksource in ARMv7 Fan Rong
2013-09-12 11:24   ` Mark Rutland
2013-09-12 14:33     ` Russell King - ARM Linux
2013-09-12 16:09       ` cinifr
2013-09-12 15:39     ` [linux-sunxi] " Ian Campbell
2013-09-12 16:07     ` cinifr
2013-09-12 16:39       ` Marc Zyngier
2013-09-13  8:49         ` cinifr
2013-09-13  9:30           ` Marc Zyngier
2013-09-13 13:09             ` cinifr
2013-09-13 13:40               ` Marc Zyngier
2013-09-13 14:55                 ` cinifr
2013-09-18  9:03                 ` cinifr
2013-09-14 12:05             ` maxime.ripard at free-electrons.com
2013-09-16  8:16               ` Marc Zyngier [this message]
2013-09-12  6:51 ` [PATCH 4/4] Add arch count timer node in dts for Allwinner A20(sunxi 7i) Fan Rong
2013-09-12 14:57   ` Mark Rutland
2013-09-12 15:44     ` [linux-sunxi] " Ian Campbell
2013-09-12 16:23       ` cinifr
2013-09-12 19:53         ` Henrik Nordström
2013-09-12 14:39 ` [PATCH 0/4] Add smp support for Allwinner A20 and phy arch count timer Mark Rutland
2013-09-12 15:46   ` cinifr
2013-09-13 11:20     ` Mark Rutland
2013-09-13 13:23       ` cinifr

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=5236BE45.1090408@arm.com \
    --to=marc.zyngier@arm.com \
    --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 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).