From: Ian Campbell Subject: Re: [PATCH] xen: arm: vtimer fixes for arm64 Date: Fri, 6 Dec 2013 17:06:58 +0000 Message-ID: <1386349618.25188.8.camel@kazak.uk.xensource.com> References: <1386248297-16577-1-git-send-email-ian.campbell@citrix.com> <52A1FBA1.7060402@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52A1FBA1.7060402@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2013-12-06 at 16:30 +0000, Julien Grall wrote: > > On 12/05/2013 12:58 PM, Ian Campbell wrote: > > The code was writing back the register, even for writes and didn't implement > > CNTPCT at all. > > > > Signed-off-by: Ian Campbell > > --- > > xen/arch/arm/vtimer.c | 51 ++++++++++++++++++++++++++++++++++--------------- > > 1 file changed, 36 insertions(+), 15 deletions(-) > > > > diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c > > index f323453..dcda2b2 100644 > > --- a/xen/arch/arm/vtimer.c > > +++ b/xen/arch/arm/vtimer.c > > @@ -165,6 +165,27 @@ static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read) > > } > > } > > > > +static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read) > > +{ > > + struct vcpu *v = current; > > + uint64_t ticks; > > + s_time_t now; > > + > > + if ( read ) > > + { > > + now = NOW() - v->domain->arch.phys_timer_base.offset; > > + ticks = ns_to_ticks(now); > > + *r = ticks; > > + return 1; > > + } > > + else > > + { > > + gdprintk(XENLOG_DEBUG, "READ from R/O CNTPCT\n"); > > s/READ/WRITE/ ? Yeah, copied blindly from the existing wrong code! > Except this minor typo: > > Acked-by: Julien Grall Thanks.