Skip to content

Commit

Permalink
arm64: Disable EL2 traps for BRBE instructions executed in EL1
Browse files Browse the repository at this point in the history
This disables EL2 traps for BRBE instructions executed in EL1. This would
enable BRBE to be configured and used successfully in the guest kernel.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
  • Loading branch information
Anshuman Khandual authored and intel-lab-lkp committed Mar 24, 2023
1 parent 010338d commit 457bbac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/arm64/include/asm/el2_setup.h
Expand Up @@ -161,6 +161,16 @@
msr_s SYS_HFGWTR_EL2, x0
msr_s SYS_HFGITR_EL2, xzr

mrs x1, id_aa64dfr0_el1
ubfx x1, x1, #ID_AA64DFR0_EL1_BRBE_SHIFT, #4
cbz x1, .Lskip_brbe_\@

mov x0, xzr
orr x0, x0, #HFGITR_EL2_nBRBIALL
orr x0, x0, #HFGITR_EL2_nBRBINJ
msr_s SYS_HFGITR_EL2, x0

.Lskip_brbe_\@:
mrs x1, id_aa64pfr0_el1 // AMU traps UNDEF without AMU
ubfx x1, x1, #ID_AA64PFR0_EL1_AMU_SHIFT, #4
cbz x1, .Lskip_fgt_\@
Expand Down

0 comments on commit 457bbac

Please sign in to comment.