From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 06/12] xen: arm: correctly handle vtimer traps from userspace Date: Thu, 26 Mar 2015 11:09:12 +0000 Message-ID: <1427368152.13935.15.camel@citrix.com> References: <1427293339.10784.83.camel@citrix.com> <1427293356-5714-6-git-send-email-ian.campbell@citrix.com> <55130145.7010908@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55130145.7010908@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 Wed, 2015-03-25 at 18:41 +0000, Julien Grall wrote: > Hi Ian, > > On 25/03/15 14:22, Ian Campbell wrote: > > -static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read) > > +static int vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read) > > { > > struct vcpu *v = current; > > s_time_t now; > > > > + if ( psr_mode_is_user(regs) && > > + !(READ_SYSREG(CNTKCTL_EL1) & CNTKCTL_EL1_EL0PTEN) ) > > + return 0; > > + > > Would it make sense to create a macro for this check? The code is pretty > much the same on every function except the field to check > (EL0PTEN/EL0PCTEN). It might, I'll have a go. > > Either way: > > Reviewed-by: Julien Grall > > Regards, >