Skip to content

Commit ec0067a

Browse files
brooniectmarinas
authored andcommitted
arm64/sme: Remove _EL0 from name of SVCR - FIXME sysreg.h
The defines for SVCR call it SVCR_EL0 however the architecture calls the register SVCR with no _EL0 suffix. In preparation for generating the sysreg definitions rename to match the architecture, no functional change. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent e65fc01 commit ec0067a

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

arch/arm64/include/asm/fpsimd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ extern void fpsimd_save_and_flush_cpu_state(void);
6767

6868
static inline bool thread_sm_enabled(struct thread_struct *thread)
6969
{
70-
return system_supports_sme() && (thread->svcr & SVCR_EL0_SM_MASK);
70+
return system_supports_sme() && (thread->svcr & SVCR_SM_MASK);
7171
}
7272

7373
static inline bool thread_za_enabled(struct thread_struct *thread)
7474
{
75-
return system_supports_sme() && (thread->svcr & SVCR_EL0_ZA_MASK);
75+
return system_supports_sme() && (thread->svcr & SVCR_ZA_MASK);
7676
}
7777

7878
/* Maximum VL that SVE/SME VL-agnostic software can transparently support */

arch/arm64/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static inline unsigned int thread_get_sme_vl(struct thread_struct *thread)
192192

193193
static inline unsigned int thread_get_cur_vl(struct thread_struct *thread)
194194
{
195-
if (system_supports_sme() && (thread->svcr & SVCR_EL0_SM_MASK))
195+
if (system_supports_sme() && (thread->svcr & SVCR_SM_MASK))
196196
return thread_get_sme_vl(thread);
197197
else
198198
return thread_get_sve_vl(thread);

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@
479479
#define SYS_RNDR_EL0 sys_reg(3, 3, 2, 4, 0)
480480
#define SYS_RNDRRS_EL0 sys_reg(3, 3, 2, 4, 1)
481481

482-
#define SYS_SVCR_EL0 sys_reg(3, 3, 4, 2, 2)
483-
#define SVCR_EL0_ZA_MASK 2
484-
#define SVCR_EL0_SM_MASK 1
482+
#define SYS_SVCR sys_reg(3, 3, 4, 2, 2)
483+
#define SVCR_ZA_MASK 2
484+
#define SVCR_SM_MASK 1
485485

486486
#define SYS_PMCR_EL0 sys_reg(3, 3, 9, 12, 0)
487487
#define SYS_PMCNTENSET_EL0 sys_reg(3, 3, 9, 12, 1)

arch/arm64/kernel/fpsimd.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static void task_fpsimd_load(void)
410410
if (test_thread_flag(TIF_SME))
411411
sme_set_vq(sve_vq_from_vl(sme_vl) - 1);
412412

413-
write_sysreg_s(current->thread.svcr, SYS_SVCR_EL0);
413+
write_sysreg_s(current->thread.svcr, SYS_SVCR);
414414

415415
if (thread_za_enabled(&current->thread))
416416
za_load_state(current->thread.za_state);
@@ -462,15 +462,15 @@ static void fpsimd_save(void)
462462

463463
if (system_supports_sme()) {
464464
u64 *svcr = last->svcr;
465-
*svcr = read_sysreg_s(SYS_SVCR_EL0);
465+
*svcr = read_sysreg_s(SYS_SVCR);
466466

467-
*svcr = read_sysreg_s(SYS_SVCR_EL0);
467+
*svcr = read_sysreg_s(SYS_SVCR);
468468

469-
if (*svcr & SYS_SVCR_EL0_ZA_MASK)
469+
if (*svcr & SVCR_ZA_MASK)
470470
za_save_state(last->za_state);
471471

472472
/* If we are in streaming mode override regular SVE. */
473-
if (*svcr & SYS_SVCR_EL0_SM_MASK) {
473+
if (*svcr & SVCR_SM_MASK) {
474474
save_sve_regs = true;
475475
save_ffr = system_supports_fa64();
476476
vl = last->sme_vl;
@@ -852,8 +852,8 @@ int vec_set_vector_length(struct task_struct *task, enum vec_type type,
852852
sve_to_fpsimd(task);
853853

854854
if (system_supports_sme() && type == ARM64_VEC_SME) {
855-
task->thread.svcr &= ~(SYS_SVCR_EL0_SM_MASK |
856-
SYS_SVCR_EL0_ZA_MASK);
855+
task->thread.svcr &= ~(SVCR_SM_MASK |
856+
SVCR_ZA_MASK);
857857
clear_thread_flag(TIF_SME);
858858
}
859859

@@ -1915,10 +1915,10 @@ void __efi_fpsimd_begin(void)
19151915
__this_cpu_write(efi_sve_state_used, true);
19161916

19171917
if (system_supports_sme()) {
1918-
svcr = read_sysreg_s(SYS_SVCR_EL0);
1918+
svcr = read_sysreg_s(SYS_SVCR);
19191919

19201920
if (!system_supports_fa64())
1921-
ffr = svcr & SVCR_EL0_SM_MASK;
1921+
ffr = svcr & SVCR_SM_MASK;
19221922

19231923
__this_cpu_write(efi_sm_state, ffr);
19241924
}
@@ -1928,8 +1928,8 @@ void __efi_fpsimd_begin(void)
19281928
ffr);
19291929

19301930
if (system_supports_sme())
1931-
sysreg_clear_set_s(SYS_SVCR_EL0,
1932-
SVCR_EL0_SM_MASK, 0);
1931+
sysreg_clear_set_s(SYS_SVCR,
1932+
SVCR_SM_MASK, 0);
19331933

19341934
} else {
19351935
fpsimd_save_state(this_cpu_ptr(&efi_fpsimd_state));
@@ -1962,9 +1962,9 @@ void __efi_fpsimd_end(void)
19621962
*/
19631963
if (system_supports_sme()) {
19641964
if (__this_cpu_read(efi_sm_state)) {
1965-
sysreg_clear_set_s(SYS_SVCR_EL0,
1965+
sysreg_clear_set_s(SYS_SVCR,
19661966
0,
1967-
SVCR_EL0_SM_MASK);
1967+
SVCR_SM_MASK);
19681968
if (!system_supports_fa64())
19691969
ffr = efi_sm_state;
19701970
}

arch/arm64/kernel/ptrace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,10 +867,10 @@ static int sve_set_common(struct task_struct *target,
867867

868868
switch (type) {
869869
case ARM64_VEC_SVE:
870-
target->thread.svcr &= ~SYS_SVCR_EL0_SM_MASK;
870+
target->thread.svcr &= ~SVCR_SM_MASK;
871871
break;
872872
case ARM64_VEC_SME:
873-
target->thread.svcr |= SYS_SVCR_EL0_SM_MASK;
873+
target->thread.svcr |= SVCR_SM_MASK;
874874
break;
875875
default:
876876
WARN_ON_ONCE(1);
@@ -1100,7 +1100,7 @@ static int za_set(struct task_struct *target,
11001100

11011101
/* If there is no data then disable ZA */
11021102
if (!count) {
1103-
target->thread.svcr &= ~SYS_SVCR_EL0_ZA_MASK;
1103+
target->thread.svcr &= ~SVCR_ZA_MASK;
11041104
goto out;
11051105
}
11061106

@@ -1125,7 +1125,7 @@ static int za_set(struct task_struct *target,
11251125

11261126
/* Mark ZA as active and let userspace use it */
11271127
set_tsk_thread_flag(target, TIF_SME);
1128-
target->thread.svcr |= SYS_SVCR_EL0_ZA_MASK;
1128+
target->thread.svcr |= SVCR_ZA_MASK;
11291129

11301130
out:
11311131
fpsimd_flush_task_state(target);

arch/arm64/kernel/signal.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
288288

289289
if (sve.head.size <= sizeof(*user->sve)) {
290290
clear_thread_flag(TIF_SVE);
291-
current->thread.svcr &= ~SYS_SVCR_EL0_SM_MASK;
291+
current->thread.svcr &= ~SVCR_SM_MASK;
292292
goto fpsimd_only;
293293
}
294294

@@ -321,7 +321,7 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
321321
return -EFAULT;
322322

323323
if (sve.flags & SVE_SIG_FLAG_SM)
324-
current->thread.svcr |= SYS_SVCR_EL0_SM_MASK;
324+
current->thread.svcr |= SVCR_SM_MASK;
325325
else
326326
set_thread_flag(TIF_SVE);
327327

@@ -398,7 +398,7 @@ static int restore_za_context(struct user_ctxs __user *user)
398398
return -EINVAL;
399399

400400
if (za.head.size <= sizeof(*user->za)) {
401-
current->thread.svcr &= ~SYS_SVCR_EL0_ZA_MASK;
401+
current->thread.svcr &= ~SVCR_ZA_MASK;
402402
return 0;
403403
}
404404

@@ -419,7 +419,7 @@ static int restore_za_context(struct user_ctxs __user *user)
419419

420420
sme_alloc(current);
421421
if (!current->thread.za_state) {
422-
current->thread.svcr &= ~SYS_SVCR_EL0_ZA_MASK;
422+
current->thread.svcr &= ~SVCR_ZA_MASK;
423423
clear_thread_flag(TIF_SME);
424424
return -ENOMEM;
425425
}
@@ -432,7 +432,7 @@ static int restore_za_context(struct user_ctxs __user *user)
432432
return -EFAULT;
433433

434434
set_thread_flag(TIF_SME);
435-
current->thread.svcr |= SYS_SVCR_EL0_ZA_MASK;
435+
current->thread.svcr |= SVCR_ZA_MASK;
436436

437437
return 0;
438438
}
@@ -922,8 +922,8 @@ static void setup_return(struct pt_regs *regs, struct k_sigaction *ka,
922922

923923
/* Signal handlers are invoked with ZA and streaming mode disabled */
924924
if (system_supports_sme()) {
925-
current->thread.svcr &= ~(SYS_SVCR_EL0_ZA_MASK |
926-
SYS_SVCR_EL0_SM_MASK);
925+
current->thread.svcr &= ~(SVCR_ZA_MASK |
926+
SVCR_SM_MASK);
927927
sme_smstop();
928928
}
929929

arch/arm64/kernel/syscall.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ static inline void fp_user_discard(void)
174174
* need updating.
175175
*/
176176
if (system_supports_sme() && test_thread_flag(TIF_SME)) {
177-
u64 svcr = read_sysreg_s(SYS_SVCR_EL0);
177+
u64 svcr = read_sysreg_s(SYS_SVCR);
178178

179-
if (svcr & SYS_SVCR_EL0_SM_MASK)
179+
if (svcr & SVCR_SM_MASK)
180180
sme_smstop_sm();
181181
}
182182

arch/arm64/kvm/fpsimd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
9696
if (read_sysreg(cpacr_el1) & CPACR_EL1_SMEN_EL0EN)
9797
vcpu->arch.flags |= KVM_ARM64_HOST_SME_ENABLED;
9898

99-
if (read_sysreg_s(SYS_SVCR_EL0) &
100-
(SYS_SVCR_EL0_SM_MASK | SYS_SVCR_EL0_ZA_MASK)) {
99+
if (read_sysreg_s(SYS_SVCR) &
100+
(SVCR_SM_MASK | SVCR_ZA_MASK)) {
101101
vcpu->arch.flags &= ~KVM_ARM64_FP_HOST;
102102
fpsimd_save_and_flush_cpu_state();
103103
}

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
16851685
{ SYS_DESC(SYS_SMIDR_EL1), undef_access },
16861686
{ SYS_DESC(SYS_CSSELR_EL1), access_csselr, reset_unknown, CSSELR_EL1 },
16871687
{ SYS_DESC(SYS_CTR_EL0), access_ctr },
1688-
{ SYS_DESC(SYS_SVCR_EL0), undef_access },
1688+
{ SYS_DESC(SYS_SVCR), undef_access },
16891689

16901690
{ PMU_SYS_REG(SYS_PMCR_EL0), .access = access_pmcr,
16911691
.reset = reset_pmcr, .reg = PMCR_EL0 },

0 commit comments

Comments
 (0)