Skip to content

Commit 7052e80

Browse files
Marc Zyngierwilldeacon
authored andcommitted
arm64/sysreg: Get rid of the TCR2_EL1x SysregFields
TCR2_EL1x is a pretty bizarre construct, as it is shared between TCR2_EL1 and TCR2_EL12. But the latter is obviously only an accessor to the former. In order to make things more consistent, upgrade TCR2_EL1x to a full-blown sysreg definition for TCR2_EL1, and describe TCR2_EL12 as a mapping to TCR2_EL1. This results in a couple of minor changes to the actual code. Acked-by: Mark Rutland <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 078bc96 commit 7052e80

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ static void cpu_enable_mops(const struct arm64_cpu_capabilities *__unused)
23752375
#ifdef CONFIG_ARM64_POE
23762376
static void cpu_enable_poe(const struct arm64_cpu_capabilities *__unused)
23772377
{
2378-
sysreg_clear_set(REG_TCR2_EL1, 0, TCR2_EL1x_E0POE);
2378+
sysreg_clear_set(REG_TCR2_EL1, 0, TCR2_EL1_E0POE);
23792379
sysreg_clear_set(CPACR_EL1, 0, CPACR_ELx_E0POE);
23802380
}
23812381
#endif

arch/arm64/kvm/at.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static bool s1pie_enabled(struct kvm_vcpu *vcpu, enum trans_regime regime)
111111
return vcpu_read_sys_reg(vcpu, TCR2_EL2) & TCR2_EL2_PIE;
112112
case TR_EL10:
113113
return (__vcpu_sys_reg(vcpu, HCRX_EL2) & HCRX_EL2_TCR2En) &&
114-
(__vcpu_sys_reg(vcpu, TCR2_EL1) & TCR2_EL1x_PIE);
114+
(__vcpu_sys_reg(vcpu, TCR2_EL1) & TCR2_EL1_PIE);
115115
default:
116116
BUG();
117117
}
@@ -140,8 +140,8 @@ static void compute_s1poe(struct kvm_vcpu *vcpu, struct s1_walk_info *wi)
140140
}
141141

142142
val = __vcpu_sys_reg(vcpu, TCR2_EL1);
143-
wi->poe = val & TCR2_EL1x_POE;
144-
wi->e0poe = val & TCR2_EL1x_E0POE;
143+
wi->poe = val & TCR2_EL1_POE;
144+
wi->e0poe = val & TCR2_EL1_E0POE;
145145
}
146146
}
147147

arch/arm64/mm/proc.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ alternative_else_nop_endif
501501
#ifdef CONFIG_ARM64_HAFT
502502
cmp x9, ID_AA64MMFR1_EL1_HAFDBS_HAFT
503503
b.lt 1f
504-
orr tcr2, tcr2, TCR2_EL1x_HAFT
504+
orr tcr2, tcr2, TCR2_EL1_HAFT
505505
#endif /* CONFIG_ARM64_HAFT */
506506
1:
507507
#endif /* CONFIG_ARM64_HW_AFDBM */
@@ -532,7 +532,8 @@ alternative_else_nop_endif
532532
#undef PTE_MAYBE_NG
533533
#undef PTE_MAYBE_SHARED
534534

535-
orr tcr2, tcr2, TCR2_EL1x_PIE
535+
orr tcr2, tcr2, TCR2_EL1_PIE
536+
msr REG_TCR2_EL1, x0
536537

537538
.Lskip_indirection:
538539

arch/arm64/tools/sysreg

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,7 +3000,7 @@ Sysreg TTBR1_EL1 3 0 2 0 1
30003000
Fields TTBRx_EL1
30013001
EndSysreg
30023002

3003-
SysregFields TCR2_EL1x
3003+
Sysreg TCR2_EL1 3 0 2 0 3
30043004
Res0 63:16
30053005
Field 15 DisCH1
30063006
Field 14 DisCH0
@@ -3014,14 +3014,10 @@ Field 3 POE
30143014
Field 2 E0POE
30153015
Field 1 PIE
30163016
Field 0 PnCH
3017-
EndSysregFields
3018-
3019-
Sysreg TCR2_EL1 3 0 2 0 3
3020-
Fields TCR2_EL1x
30213017
EndSysreg
30223018

30233019
Sysreg TCR2_EL12 3 5 2 0 3
3024-
Fields TCR2_EL1x
3020+
Mapping TCR2_EL1
30253021
EndSysreg
30263022

30273023
Sysreg TCR2_EL2 3 4 2 0 3

0 commit comments

Comments
 (0)