[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130914120557.GB2746@lukather>
Date: Sat, 14 Sep 2013 14:05:57 +0200
From: "maxime.ripard@...e-electrons.com" <maxime.ripard@...e-electrons.com>
To: Marc Zyngier <marc.zyngier@....com>
Cc: cinifr <cinifr@...il.com>, Mark Rutland <Mark.Rutland@....com>,
"coosty@....com" <coosty@....com>,
"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
"linux@....linux.org.uk" <linux@....linux.org.uk>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pawel.moll@....co" <pawel.moll@....co>,
"rob.herring@...xeda.com" <rob.herring@...xeda.com>,
"linux-sunxi@...glegroups.com" <linux-sunxi@...glegroups.com>
Subject: Re: [PATCH 3/4] Add physical count arch timer support for
clocksource in ARMv7.
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@....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?
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?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists