[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] xen: arm: traps: check hsr.ec for ARM32



Hi Peng,

On 21/09/15 08:07, Peng Fan wrote:
> To ARM64, "if ( hsr.ec >= 0x10 ) return 1;" is ok for unconditional
> check, but to ARM32, we need to use 'hsr.ec >> 30' to check.

hsr.ec is encoded on 5 bits, therefore the shift you suggest is wrong.
Maybe you wanted to use (hsr.ec >> 4)?

Although, can you explain why you need a different check for ARM32?

Regards,

> Signed-off-by: Peng Fan <Peng.Fan@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> Cc: Julien Grall <julien.grall@xxxxxxxxxx>
> ---
>  xen/arch/arm/traps.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 9d2bd6a..2e2b1f2 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1531,8 +1531,13 @@ static int check_conditional_instr(struct 
> cpu_user_regs *regs,
>      int cond;
>  
>      /* Unconditional Exception classes */
> +#ifdef CONFIG_ARM_64
>      if ( hsr.ec >= 0x10 )
>          return 1;
> +#else
> +    if ( hsr.ec >> 30 )
> +        return 1;
> +#endif
>  
>      /* Check for valid condition in hsr */
>      cond = hsr.cond.ccvalid ? hsr.cond.cc : -1;
> 


-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.