From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 06/19] xen: arm: add minimum exception level argument to trap handler helpers Date: Fri, 3 Apr 2015 14:58:20 +0200 Message-ID: <551E8E6C.8020400@citrix.com> References: <1427796446.2115.34.camel@citrix.com> <1427796462-24376-6-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427796462-24376-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: julien.grall@linaro.org, tim@xen.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 31/03/2015 12:07, Ian Campbell wrote: > Removes a load of boiler plate. > > Signed-off-by: Ian Campbell > --- > xen/arch/arm/traps.c | 65 +++++++++++++++++++++++++------------------------- > 1 file changed, 32 insertions(+), 33 deletions(-) > > diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c > index ebc09f9..c9c98d3 100644 > --- a/xen/arch/arm/traps.c > +++ b/xen/arch/arm/traps.c > @@ -1578,8 +1578,12 @@ static void advance_pc(struct cpu_user_regs *regs, const union hsr hsr) > static void handle_raz_wi(struct cpu_user_regs *regs, > register_t *reg, > bool_t read, > - const union hsr hsr) > + const union hsr hsr, > + int min_el) > { I would add an ASSERT((min_el == 0) || (min_el == 1)) in order to make clear that min_el should be either EL0 or EL1. > + if ( min_el > 0 && psr_mode_is_user(regs) ) > + return inject_undef_exception(regs, hsr); > + > if ( read ) > *reg = 0; > /* else: write ignored */ > @@ -1591,8 +1595,12 @@ static void handle_raz_wi(struct cpu_user_regs *regs, > static void handle_wo_wi(struct cpu_user_regs *regs, > register_t *reg, > bool_t read, > - const union hsr hsr) > + const union hsr hsr, > + int min_el) > { Ditto > + if ( min_el > 0 && psr_mode_is_user(regs) ) > + return inject_undef_exception(regs, hsr); > + > if ( read ) > return inject_undef_exception(regs, hsr); > /* else: ignore */ > @@ -1604,8 +1612,12 @@ static void handle_wo_wi(struct cpu_user_regs *regs, > static void handle_ro_raz(struct cpu_user_regs *regs, > register_t *reg, > bool_t read, > - const union hsr hsr) > + const union hsr hsr, > + int min_el) > { Ditto > + if ( min_el > 0 && psr_mode_is_user(regs) ) > + return inject_undef_exception(regs, hsr); > + > if ( !read ) > return inject_undef_exception(regs, hsr); > /* else: raz */ Regards, -- Julien Grall