Skip to content

Commit 8083499

Browse files
robherringwilldeacon
authored andcommitted
arm64: el2_setup.h: Make __init_el2_fgt labels consistent, again
Commit 5b39db6 ("arm64: el2_setup.h: Rename some labels to be more diff-friendly") reworked the labels in __init_el2_fgt to say what's skipped rather than what the target location is. The exception was "set_fgt_" which is where registers are written. In reviewing the BRBE additions, Will suggested "set_debug_fgt_" where HDFGxTR_EL2 are written. Doing that would partially revert commit 5b39db6 undoing the goal of minimizing additions here, but it would follow the convention for labels where registers are written. So let's do both. Branches that skip something go to a "skip" label and places that set registers have a "set" label. This results in some double labels, but it makes things entirely consistent. While we're here, the SME skip label was incorrectly named, so fix it. Reported-by: Will Deacon <will@kernel.org> Cc: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20250520-arm-brbe-v19-v22-2-c1ddde38e7f8@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent 694f574 commit 8083499

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arch/arm64/include/asm/el2_setup.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,21 @@
204204
orr x0, x0, #(1 << 62)
205205

206206
.Lskip_spe_fgt_\@:
207+
208+
.Lset_debug_fgt_\@:
207209
msr_s SYS_HDFGRTR_EL2, x0
208210
msr_s SYS_HDFGWTR_EL2, x0
209211

210212
mov x0, xzr
211213
mrs x1, id_aa64pfr1_el1
212214
ubfx x1, x1, #ID_AA64PFR1_EL1_SME_SHIFT, #4
213-
cbz x1, .Lskip_debug_fgt_\@
215+
cbz x1, .Lskip_sme_fgt_\@
214216

215217
/* Disable nVHE traps of TPIDR2 and SMPRI */
216218
orr x0, x0, #HFGxTR_EL2_nSMPRI_EL1_MASK
217219
orr x0, x0, #HFGxTR_EL2_nTPIDR2_EL0_MASK
218220

219-
.Lskip_debug_fgt_\@:
221+
.Lskip_sme_fgt_\@:
220222
mrs_s x1, SYS_ID_AA64MMFR3_EL1
221223
ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4
222224
cbz x1, .Lskip_pie_fgt_\@
@@ -237,12 +239,14 @@
237239
/* GCS depends on PIE so we don't check it if PIE is absent */
238240
mrs_s x1, SYS_ID_AA64PFR1_EL1
239241
ubfx x1, x1, #ID_AA64PFR1_EL1_GCS_SHIFT, #4
240-
cbz x1, .Lset_fgt_\@
242+
cbz x1, .Lskip_gce_fgt_\@
241243

242244
/* Disable traps of access to GCS registers at EL0 and EL1 */
243245
orr x0, x0, #HFGxTR_EL2_nGCS_EL1_MASK
244246
orr x0, x0, #HFGxTR_EL2_nGCS_EL0_MASK
245247

248+
.Lskip_gce_fgt_\@:
249+
246250
.Lset_fgt_\@:
247251
msr_s SYS_HFGRTR_EL2, x0
248252
msr_s SYS_HFGWTR_EL2, x0

0 commit comments

Comments
 (0)