Skip to content

Commit 18c9aa4

Browse files
Marc Zyngierwilldeacon
authored andcommitted
arm64: Add an override for ID_AA64SMFR0_EL1.FA64
Add a specific override for ID_AA64SMFR0_EL1.FA64, which disables the full A64 streaming SVE mode. Note that no alias is provided for this, as this is already covered by arm64.nosme, and is only added as a debugging facility. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 504ee23 commit 18c9aa4

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

arch/arm64/kernel/hyp-stub.S

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,18 @@ SYM_CODE_START_LOCAL(__finalise_el2)
122122
msr sctlr_el2, x1
123123
isb
124124

125-
mov x1, #0 // SMCR controls
125+
mov x0, #0 // SMCR controls
126126

127-
mrs_s x2, SYS_ID_AA64SMFR0_EL1
128-
ubfx x2, x2, #ID_AA64SMFR0_FA64_SHIFT, #1 // Full FP in SM?
129-
cbz x2, .Lskip_sme_fa64
127+
// Full FP in SM?
128+
mrs_s x1, SYS_ID_AA64SMFR0_EL1
129+
__check_override id_aa64smfr0 ID_AA64SMFR0_FA64_SHIFT 1 .Linit_sme_fa64 .Lskip_sme_fa64
130130

131-
orr x1, x1, SMCR_ELx_FA64_MASK
131+
.Linit_sme_fa64:
132+
orr x0, x0, SMCR_ELx_FA64_MASK
132133
.Lskip_sme_fa64:
133134

134-
orr x1, x1, #SMCR_ELx_LEN_MASK // Enable full SME vector
135-
msr_s SYS_SMCR_EL2, x1 // length for EL1.
135+
orr x0, x0, #SMCR_ELx_LEN_MASK // Enable full SME vector
136+
msr_s SYS_SMCR_EL2, x0 // length for EL1.
136137

137138
mrs_s x1, SYS_SMIDR_EL1 // Priority mapping supported?
138139
ubfx x1, x1, #SMIDR_EL1_SMPS_SHIFT, #1

arch/arm64/kernel/idreg-override.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ static const struct ftr_set_desc isar2 __initconst = {
127127
},
128128
};
129129

130+
static const struct ftr_set_desc smfr0 __initconst = {
131+
.name = "id_aa64smfr0",
132+
.override = &id_aa64smfr0_override,
133+
.fields = {
134+
/* FA64 is a one bit field... :-/ */
135+
{ "fa64", ID_AA64SMFR0_FA64_SHIFT, 1, },
136+
{}
137+
},
138+
};
139+
130140
extern struct arm64_ftr_override kaslr_feature_override;
131141

132142
static const struct ftr_set_desc kaslr __initconst = {
@@ -146,6 +156,7 @@ static const struct ftr_set_desc * const regs[] __initconst = {
146156
&pfr1,
147157
&isar1,
148158
&isar2,
159+
&smfr0,
149160
&kaslr,
150161
};
151162

0 commit comments

Comments
 (0)