linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: amittomer25@gmail.com (Amit Tomer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1] Ftrace: arm/arm64: Define a new arm/arm64 trace clock source based on CNTPCT/CNTPCT_EL0 register.
Date: Thu, 29 Oct 2015 19:17:31 +0530	[thread overview]
Message-ID: <CABHD4K_DXCNpOS9esA9yEANaYocNMG3fcQ4_uRTKQHF-8JiQvw@mail.gmail.com> (raw)
In-Reply-To: <20151029113849.GC28221@leverpostej>

> Regardless of the host, you cannot know whether it is safe to access
> in a guest. It could bring down the system.
>
> The host kernel could safely access the physical counter were it booted
> at EL2, because it could grant itself access.

May be I am totally wrong here but it doesn't look to be good . if
Linux image does not boot at hyp mode,
there is no way to use arch timers, Not true?

But I could see even if Linux image booted in EL1 has the access to
Physical timer/counters that is
been allowed by firmware it self.

ENTRY(armv8_switch_to_el1)
        switch_el x0, 0f, 1f, 0f
0:      ret
1:
        /* Initialize Generic Timers */
        mrs     x0, cnthctl_el2
        orr     x0, x0, #0x3            /* Enable EL1 access to timers */
        msr     cnthctl_el2, x0
        msr     cntvoff_el2, x0
        mrs     x0, cntkctl_el1
        orr     x0, x0, #0x3            /* Enable EL0 access to timers */
        msr     cntkctl_el1, x0

Sorry, if it's just all stupid.

Thanks,
Amit.

  reply	other threads:[~2015-10-29 13:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 10:15 [PATCH v1] Ftrace: arm/arm64: Define a new arm/arm64 trace clock source based on CNTPCT/CNTPCT_EL0 register Amit
2015-10-28 12:47 ` Mark Rutland
2015-10-28 19:02   ` Amit Tomer
2015-10-29 11:38     ` Mark Rutland
2015-10-29 13:47       ` Amit Tomer [this message]
2015-10-29 14:19         ` 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=CABHD4K_DXCNpOS9esA9yEANaYocNMG3fcQ4_uRTKQHF-8JiQvw@mail.gmail.com \
    --to=amittomer25@gmail.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).