From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 06/12] xen: arm: correctly handle vtimer traps from userspace Date: Wed, 25 Mar 2015 18:41:09 +0000 Message-ID: <55130145.7010908@linaro.org> References: <1427293339.10784.83.camel@citrix.com> <1427293356-5714-6-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: <1427293356-5714-6-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , xen-devel@lists.xen.org Cc: tim@xen.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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). Either way: Reviewed-by: Julien Grall Regards, -- Julien Grall