[PATCH 01/13] arm64: Add ESR_EL2_EC macros to hyp-stub

Mark Rutland mark.rutland at arm.com
Mon Sep 15 09:10:15 PDT 2014


On Tue, Sep 09, 2014 at 11:49:04PM +0100, Geoff Levand wrote:
> To improve the readability of the el1_sync routine in hyp-stub.S replace the
> numeric immediate values with preprocessor macros ESR_EL2_EC_SHIFT and
> ESR_EL2_EC_HVC64.
> 
> Signed-off-by: Geoff Levand <geoff at infradead.org>
> ---
>  arch/arm64/kernel/hyp-stub.S | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S
> index a272f33..2d960a9 100644
> --- a/arch/arm64/kernel/hyp-stub.S
> +++ b/arch/arm64/kernel/hyp-stub.S
> @@ -52,10 +52,13 @@ ENDPROC(__hyp_stub_vectors)
>  
>  	.align 11
>  
> +#define ESR_EL2_EC_SHIFT	26
> +#define ESR_EL2_EC_HVC64	0x16

These exist in arch/arm64/include/asm/kvm_arm.h, no?

If anything that should be folded into arch/arm64/include/asm/esr.h...

Mark.

> +
>  el1_sync:
>  	mrs	x1, esr_el2
> -	lsr	x1, x1, #26
> -	cmp	x1, #0x16
> +	lsr	x1, x1, #ESR_EL2_EC_SHIFT
> +	cmp	x1, #ESR_EL2_EC_HVC64
>  	b.ne	2f				// Not an HVC trap
>  	cbz	x0, 1f
>  	msr	vbar_el2, x0			// Set vbar_el2
> -- 
> 1.9.1
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 



More information about the kexec mailing list