Skip to content

Commit

Permalink
arm64: entry: Save some nops when CONFIG_ARM64_PSEUDO_NMI is not set
Browse files Browse the repository at this point in the history
Arm64 pseudo-NMI feature code brings some additional nops
when CONFIG_ARM64_PSEUDO_NMI is not set, which is not
necessary. So add necessary ifdeffery to avoid it.

Signed-off-by: He Ying <heying24@huawei.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20220112032410.29231-1-heying24@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
  • Loading branch information
He Ying authored and Will Deacon committed Feb 15, 2022
1 parent dfd42fa commit 3352a55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arm64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,15 @@ alternative_else_nop_endif
str w21, [sp, #S_SYSCALLNO]
.endif

#ifdef CONFIG_ARM64_PSEUDO_NMI
/* Save pmr */
alternative_if ARM64_HAS_IRQ_PRIO_MASKING
mrs_s x20, SYS_ICC_PMR_EL1
str x20, [sp, #S_PMR_SAVE]
mov x20, #GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET
msr_s SYS_ICC_PMR_EL1, x20
alternative_else_nop_endif
#endif

/* Re-enable tag checking (TCO set on exception entry) */
#ifdef CONFIG_ARM64_MTE
Expand All @@ -330,6 +332,7 @@ alternative_else_nop_endif
disable_daif
.endif

#ifdef CONFIG_ARM64_PSEUDO_NMI
/* Restore pmr */
alternative_if ARM64_HAS_IRQ_PRIO_MASKING
ldr x20, [sp, #S_PMR_SAVE]
Expand All @@ -339,6 +342,7 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKING
dsb sy // Ensure priority change is seen by redistributor
.L__skip_pmr_sync\@:
alternative_else_nop_endif
#endif

ldp x21, x22, [sp, #S_PC] // load ELR, SPSR

Expand Down

0 comments on commit 3352a55

Please sign in to comment.