From: Ian Campbell Subject: Re: [PATCH] xen: arm: vtimer fixes for arm64 Date: Fri, 6 Dec 2013 17:42:10 +0000 Message-ID: <1386351730.25188.13.camel@kazak.uk.xensource.com> References: <1386248297-16577-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2013-12-06 at 17:38 +0000, Stefano Stabellini wrote: > On Thu, 5 Dec 2013, Ian Campbell wrote: > > @@ -227,12 +242,18 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr) > > { > > case CNTP_CTL_EL0: > > vtimer_cntp_ctl(regs, &r, sysreg.read); > > - *x = r; > > + if ( sysreg.read ) > > + *x = r; > > return 1; > > case CNTP_TVAL_EL0: > > vtimer_cntp_tval(regs, &r, sysreg.read); > > - *x = r; > > + if ( sysreg.read ) > > + *x = r; > > return 1; > > Are you sure that sysreg.read == 1 means write? On the contrary, it means read. Here x points to the guest reg that is the target of the read, and r is the new value which the emulation has produced. So *x = r is implementing a read from the guest's PoV. Ian.