[PATCH 5/7] arm64: kvm: move to ESR_ELx macros

Mark Rutland mark.rutland at arm.com
Mon Jan 12 03:40:14 PST 2015


On Sun, Jan 11, 2015 at 06:27:16PM +0000, Christoffer Dall wrote:
> On Wed, Jan 07, 2015 at 12:04:18PM +0000, Mark Rutland wrote:
> > Now that we have common ESR_ELx macros, make use of them in the arm64
> > KVM code. The addition of <asm/esr.h> to the include path highlighted
> > badly ordered (i.e. not alphabetical) include lists; these are changed
> > to alphabetical order.
> >
> > There should be no functional change as a result of this patch.
> >
> > Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> > Cc: Catalin Marinas <catalin.marinas at arm.com>
> > Cc: Christoffer Dall <christoffer.dall at linaro.org>
> > Cc: Marc Zyngier <marc.zyngier at arm.com>
> > Cc: Peter Maydell <peter.maydell at linaro.org>
> > Cc: Will Deacon <will.deacon at arm.com>
> > ---
> >  arch/arm64/include/asm/kvm_emulate.h | 28 +++++++++++++++-------------
> >  arch/arm64/kvm/emulate.c             |  5 +++--
> >  arch/arm64/kvm/handle_exit.c         | 32 +++++++++++++++++---------------
> >  arch/arm64/kvm/hyp.S                 | 17 +++++++++--------
> >  arch/arm64/kvm/inject_fault.c        | 14 +++++++-------
> >  arch/arm64/kvm/sys_regs.c            | 23 +++++++++++++----------
> >  6 files changed, 64 insertions(+), 55 deletions(-)

[...]

> >  static inline int kvm_vcpu_dabt_get_as(const struct kvm_vcpu *vcpu)
> >  {
> > -     return 1 << ((kvm_vcpu_get_hsr(vcpu) & ESR_EL2_SAS) >> ESR_EL2_SAS_SHIFT);
> > +     return 1 << !!(kvm_vcpu_get_hsr(vcpu) & ESR_ELx_SAS);
> 
> huh?

Sorry, this is nonsense I derived from thinking the SAS field was a
single bit and believing I could remove the need for the shift
definition.

I'll introduce ESR_ELx_SAS_SHIFT in patch 1 and use it here.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list