Message ID | 5e1b1892eb3ecc3bccff47766675c24c650a1a14.1410302383.git.geoff@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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@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@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >
Hi Mark, On Mon, 2014-09-15 at 17:10 +0100, Mark Rutland wrote: > On Tue, Sep 09, 2014 at 11:49:04PM +0100, Geoff Levand wrote: > > +#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... OK, I'll remove this patch and add the esr.h fixup into my generic 'arm64 enhancements' series. -Geoff
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 + 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
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@infradead.org> --- arch/arm64/kernel/hyp-stub.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)