Skip to content

Commit 5b39db6

Browse files
Dave Martinwilldeacon
authored andcommitted
arm64: el2_setup.h: Rename some labels to be more diff-friendly
A minor anti-pattern has established itself in __init_el2_fgt, where each block of instructions is skipped by jumping to a label named for the next (typically unrelated) block. This makes diffs more noisy than necessary, since appending each new block to deal with some new architecture feature now requires altering a branch destination in the existing code. Fix it by naming the affected labels based on the block that is skipping itself instead, as is done elsewhere in the el2_setup code. No functional change. Signed-off-by: Dave Martin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent fc2220c commit 5b39db6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

arch/arm64/include/asm/el2_setup.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,42 +165,45 @@
165165
mrs x1, id_aa64dfr0_el1
166166
ubfx x1, x1, #ID_AA64DFR0_EL1_PMSVer_SHIFT, #4
167167
cmp x1, #3
168-
b.lt .Lset_debug_fgt_\@
168+
b.lt .Lskip_spe_fgt_\@
169169
/* Disable PMSNEVFR_EL1 read and write traps */
170170
orr x0, x0, #(1 << 62)
171171

172-
.Lset_debug_fgt_\@:
172+
.Lskip_spe_fgt_\@:
173173
msr_s SYS_HDFGRTR_EL2, x0
174174
msr_s SYS_HDFGWTR_EL2, x0
175175

176176
mov x0, xzr
177177
mrs x1, id_aa64pfr1_el1
178178
ubfx x1, x1, #ID_AA64PFR1_EL1_SME_SHIFT, #4
179-
cbz x1, .Lset_pie_fgt_\@
179+
cbz x1, .Lskip_debug_fgt_\@
180180

181181
/* Disable nVHE traps of TPIDR2 and SMPRI */
182182
orr x0, x0, #HFGxTR_EL2_nSMPRI_EL1_MASK
183183
orr x0, x0, #HFGxTR_EL2_nTPIDR2_EL0_MASK
184184

185-
.Lset_pie_fgt_\@:
185+
.Lskip_debug_fgt_\@:
186186
mrs_s x1, SYS_ID_AA64MMFR3_EL1
187187
ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4
188-
cbz x1, .Lset_fgt_\@
188+
cbz x1, .Lskip_pie_fgt_\@
189189

190190
/* Disable trapping of PIR_EL1 / PIRE0_EL1 */
191191
orr x0, x0, #HFGxTR_EL2_nPIR_EL1
192192
orr x0, x0, #HFGxTR_EL2_nPIRE0_EL1
193193

194-
.Lset_fgt_\@:
194+
.Lskip_pie_fgt_\@:
195195
msr_s SYS_HFGRTR_EL2, x0
196196
msr_s SYS_HFGWTR_EL2, x0
197197
msr_s SYS_HFGITR_EL2, xzr
198198

199199
mrs x1, id_aa64pfr0_el1 // AMU traps UNDEF without AMU
200200
ubfx x1, x1, #ID_AA64PFR0_EL1_AMU_SHIFT, #4
201-
cbz x1, .Lskip_fgt_\@
201+
cbz x1, .Lskip_amu_fgt_\@
202202

203203
msr_s SYS_HAFGRTR_EL2, xzr
204+
205+
.Lskip_amu_fgt_\@:
206+
204207
.Lskip_fgt_\@:
205208
.endm
206209

0 commit comments

Comments
 (0)