Re: [Xen-devel] [PATCH 02/12] xen: arm: handle accesses to CNTP_CVAL_EL0

2015-03-26 Thread Ian Campbell
On Thu, 2015-03-26 at 10:59 +, Ian Campbell wrote: > On Wed, 2015-03-25 at 18:32 +, Julien Grall wrote: > > On 25/03/15 14:22, Ian Campbell wrote: > > > +static int vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int > > > read) > > > +{ > > > +struct vcpu *v = current; > > >

Re: [Xen-devel] [PATCH 02/12] xen: arm: handle accesses to CNTP_CVAL_EL0

2015-03-26 Thread Ian Campbell
On Wed, 2015-03-25 at 18:32 +, Julien Grall wrote: > On 25/03/15 14:22, Ian Campbell wrote: > > +static int vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int > > read) > > +{ > > +struct vcpu *v = current; > > + > > +if ( psr_mode_is_user(regs) && > > + !(READ_SYSRE

Re: [Xen-devel] [PATCH 02/12] xen: arm: handle accesses to CNTP_CVAL_EL0

2015-03-25 Thread Julien Grall
On 25/03/15 14:22, Ian Campbell wrote: > +static int vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int > read) > +{ > +struct vcpu *v = current; > + > +if ( psr_mode_is_user(regs) && > + !(READ_SYSREG(CNTKCTL_EL1) & CNTKCTL_EL1_EL0PTEN) ) Sorry, I didn't notice it on m

Re: [Xen-devel] [PATCH 02/12] xen: arm: handle accesses to CNTP_CVAL_EL0

2015-03-25 Thread Julien Grall
Hi Ian, On 25/03/15 14:22, Ian Campbell wrote: > All OSes we have run on top of Xen use CNTP_TVAL_EL0 but for > completeness we really should handle CVAL too. > > In vtimer_emulate_cp64 pull the propagation of the 64-bit result into > two 32-bit registers out of the switch to avoid duplicating fo

[Xen-devel] [PATCH 02/12] xen: arm: handle accesses to CNTP_CVAL_EL0

2015-03-25 Thread Ian Campbell
All OSes we have run on top of Xen use CNTP_TVAL_EL0 but for completeness we really should handle CVAL too. In vtimer_emulate_cp64 pull the propagation of the 64-bit result into two 32-bit registers out of the switch to avoid duplicating for every register. We also need to initialise x now since p