The ESR_ELx_ERET_ISS_ERET* macros are a bit confusing: - ESR_ELx_ERET_ISS_ERET really indicates that we have trapped an ERETA* instruction, as opposed to an ERET - ESR_ELx_ERET_ISS_ERETA reallu indicates that we have trapped an ERETAB instruction, as opposed to an ERETAA. Repaint the two helpers such as: - ESR_ELx_ERET_ISS_ERET becomes ESR_ELx_ERET_ISS_ERETA - ESR_ELx_ERET_ISS_ERETA becomes ESR_ELx_ERET_ISS_ERETAB At the same time, use BIT() instead of raw values. Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx> --- arch/arm64/include/asm/esr.h | 4 ++-- arch/arm64/kvm/handle_exit.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h index 353fe08546cf..72c7810ccf2c 100644 --- a/arch/arm64/include/asm/esr.h +++ b/arch/arm64/include/asm/esr.h @@ -290,8 +290,8 @@ ESR_ELx_SYS64_ISS_OP2_SHIFT)) /* ISS field definitions for ERET/ERETAA/ERETAB trapping */ -#define ESR_ELx_ERET_ISS_ERET 0x2 -#define ESR_ELx_ERET_ISS_ERETA 0x1 +#define ESR_ELx_ERET_ISS_ERETA BIT(1) +#define ESR_ELx_ERET_ISS_ERETAB BIT(0) /* * ISS field definitions for floating-point exception traps diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index 617ae6dea5d5..0646c623d1da 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -219,7 +219,7 @@ static int kvm_handle_ptrauth(struct kvm_vcpu *vcpu) static int kvm_handle_eret(struct kvm_vcpu *vcpu) { - if (kvm_vcpu_get_esr(vcpu) & ESR_ELx_ERET_ISS_ERET) + if (kvm_vcpu_get_esr(vcpu) & ESR_ELx_ERET_ISS_ERETA) return kvm_handle_ptrauth(vcpu); /* -- 2.39.2