xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Julien Grall <julien.grall@linaro.org>,
	stefano.stabellini@eu.citrix.com, Tim Deegan <tim@xen.org>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 4/9] xen: arm: turn vtimer traps for cp32/64 and sysreg into #undef
Date: Wed, 14 Jan 2015 16:33:21 +0000	[thread overview]
Message-ID: <1421253201.19103.296.camel@citrix.com> (raw)
In-Reply-To: <1410424998.6166.25.camel@kazak.uk.xensource.com>

On Thu, 2014-09-11 at 09:43 +0100, Ian Campbell wrote:
> On Wed, 2014-09-10 at 11:54 -0700, Julien Grall wrote:
> > Hi Ian,
> > 
> > On 10/09/14 02:46, Ian Campbell wrote:
> > > On Tue, 2014-09-09 at 16:31 -0700, Julien Grall wrote:
> > >> Hi Ian,
> > >>
> > >> On 09/09/14 09:23, Ian Campbell wrote:
> > >>> We have allowed EL1 to access these registers directly for some time
> > >>> (at least since 4.3.0). They were only ever trapped to support very
> > >>> early models which had a buggy hypervisor timer, requiring us to use
> > >>> the phys timer for Xen itself.
> > >>> In the interests of minimising the patch for the security update just
> > >>> remove the call to vtimer_emulate and inject an #undef exception. In
> > >>> practice we will never see any of these traps.
> > >>
> > >> I disagree with the commit message, a guest may use the physical timer
> > >> rather than the virtual timer. It's the case when a guest doesn't have
> > >> the necessary code to use the virtual timer.

I was just about to dive back into this and was thinking: Is a guest
which uses the phys timer something we actually wish to support? We
already require the guest to paravirtualise other aspects of its life,
and requiring vtimer doesn't seem to step outside that boundary.

Supporting the ptimer is going to take some effort as well as the
existing code+overhead in Xen.

Do we know of any existing supported OSes which use the phys timer?

I suppose we should consider access to the counter separately from
access to the registers which allow event generation -- I could
plausibly be convinced that a guest should be able to read both phys and
virt timers (for e.g. stolen time type reasons), but only configure virt
events.

Ian.

> > >
> > > I think you've misunderstood. The guest is allowed direct access to the
> > > physical timer ever since we removed the workaround for the buggy
> > > hypervisor timer on the models. Hence we are never trapping these
> > > registers anyway. Probably I should go further here and actually remove
> > > all the phys timer emulation support from vtimer.c.
> > 
> > Are you sure? In init_interrupt_timer (xen/arch/arm/timer.c) we disable 
> > the access to the physical timer to the guest. See 
> > WRITE_SYSREG32(CNTHCTL_PA, CNTHCTL_EL2).
> 
> Hrm, I mistakenly thought that was enabling them, but we do indeed need
> to set a second bit there, this only allows access to the counter, not
> the control registers. I'll take another look.
> 
> > Hence, I don't see any save/restore for the physical timer in 
> > xen/arch/arm/vtimer.c. I only see them for the virtual timer.
> > 
> > Regards,
> > 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2015-01-14 16:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 16:22 [RFC PATCH 0/9] xen: arm: reenable support for 32-bit userspace running in 64-bit guest Ian Campbell
2014-09-09 16:23 ` [PATCH 1/9] xen: arm: Correct PMXEV cp register definitions Ian Campbell
2014-09-09 23:04   ` Julien Grall
2014-09-09 16:23 ` [PATCH 2/9] xen: arm: Factor out psr_mode_is_user Ian Campbell
2014-09-09 23:08   ` Julien Grall
2014-09-09 16:23 ` [PATCH 3/9] xen: arm: Handle 32-bit EL0 on 64-bit EL1 when advancing PC after trap Ian Campbell
2014-09-09 23:12   ` Julien Grall
2014-09-09 16:23 ` [PATCH 4/9] xen: arm: turn vtimer traps for cp32/64 and sysreg into #undef Ian Campbell
2014-09-09 23:31   ` Julien Grall
2014-09-10  9:46     ` Ian Campbell
2014-09-10 18:54       ` Julien Grall
2014-09-11  8:43         ` Ian Campbell
2015-01-14 16:33           ` Ian Campbell [this message]
2015-01-14 16:57             ` Julien Grall
2015-01-15 10:26               ` Ian Campbell
2015-01-15 12:27                 ` Julien Grall
2015-01-15 12:35                   ` Ian Campbell
2014-09-09 16:23 ` [PATCH 5/9] xen: arm: Handle CP15 register traps from userspace Ian Campbell
2014-09-09 23:42   ` Julien Grall
2014-09-10  9:48     ` Ian Campbell
2014-09-10 18:56       ` Julien Grall
2014-09-18  1:31         ` Ian Campbell
2014-09-09 16:23 ` [PATCH 6/9] xen: arm: Handle CP14 32-bit register accesses " Ian Campbell
2014-09-09 23:45   ` Julien Grall
2014-09-10  9:48     ` Ian Campbell
2015-02-10  3:40       ` Ian Campbell
2015-02-10  4:14         ` Julien Grall
2014-09-09 16:23 ` [PATCH 7/9] xen: arm: correctly handle sysreg " Ian Campbell
2014-09-09 16:23 ` [PATCH 8/9] xen: arm: handle remaining traps " Ian Campbell
2014-09-09 16:23 ` [PATCH 9/9] xen: arm: Allow traps from 32 bit userspace on 64 bit hypervisors again Ian Campbell
2014-09-09 16:23 ` [RFC PATCH 0/9] xen: arm: reenable support for 32-bit userspace running in 64-bit guest Ian Campbell

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=1421253201.19103.296.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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).