Skip to content

Commit db0d46a

Browse files
Steven Pricewilldeacon
authored andcommitted
arm64: Rename WORKAROUND_1319367 to SPECULATIVE_AT_NVHE
To match SPECULATIVE_AT_VHE let's also have a generic name for the NVHE variant. Acked-by: Marc Zyngier <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Signed-off-by: Steven Price <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent e85d68f commit db0d46a

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

arch/arm64/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,13 @@ config ARM64_ERRATUM_1286807
546546
invalidated has been observed by other observers. The
547547
workaround repeats the TLBI+DSB operation.
548548

549+
config ARM64_WORKAROUND_SPECULATIVE_AT_NVHE
550+
bool
551+
549552
config ARM64_ERRATUM_1319367
550553
bool "Cortex-A57/A72: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
551554
default y
555+
select ARM64_WORKAROUND_SPECULATIVE_AT_NVHE
552556
help
553557
This option adds work arounds for ARM Cortex-A57 erratum 1319537
554558
and A72 erratum 1319367

arch/arm64/include/asm/cpucaps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#define ARM64_WORKAROUND_CAVIUM_TX2_219_TVM 45
5656
#define ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM 46
5757
#define ARM64_WORKAROUND_1542419 47
58-
#define ARM64_WORKAROUND_1319367 48
58+
#define ARM64_WORKAROUND_SPECULATIVE_AT_NVHE 48
5959

6060
#define ARM64_NCAPS 49
6161

arch/arm64/kernel/cpu_errata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
934934
#ifdef CONFIG_ARM64_ERRATUM_1319367
935935
{
936936
.desc = "ARM erratum 1319367",
937-
.capability = ARM64_WORKAROUND_1319367,
937+
.capability = ARM64_WORKAROUND_SPECULATIVE_AT_NVHE,
938938
ERRATA_MIDR_RANGE_LIST(ca57_a72),
939939
},
940940
#endif

arch/arm64/kvm/hyp/switch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu)
119119

120120
write_sysreg(val, cptr_el2);
121121

122-
if (cpus_have_const_cap(ARM64_WORKAROUND_1319367)) {
122+
if (cpus_have_const_cap(ARM64_WORKAROUND_SPECULATIVE_AT_NVHE)) {
123123
struct kvm_cpu_context *ctxt = &vcpu->arch.ctxt;
124124

125125
isb();
@@ -173,7 +173,7 @@ static void __hyp_text __deactivate_traps_nvhe(void)
173173
{
174174
u64 mdcr_el2 = read_sysreg(mdcr_el2);
175175

176-
if (cpus_have_const_cap(ARM64_WORKAROUND_1319367)) {
176+
if (cpus_have_const_cap(ARM64_WORKAROUND_SPECULATIVE_AT_NVHE)) {
177177
u64 val;
178178

179179
/*

arch/arm64/kvm/hyp/sysreg-sr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void __hyp_text __sysreg_restore_el1_state(struct kvm_cpu_context *ctxt)
118118
write_sysreg(ctxt->sys_regs[MPIDR_EL1], vmpidr_el2);
119119
write_sysreg(ctxt->sys_regs[CSSELR_EL1], csselr_el1);
120120

121-
if (!cpus_have_const_cap(ARM64_WORKAROUND_1319367)) {
121+
if (!cpus_have_const_cap(ARM64_WORKAROUND_SPECULATIVE_AT_NVHE)) {
122122
write_sysreg_el1(ctxt->sys_regs[SCTLR_EL1], SYS_SCTLR);
123123
write_sysreg_el1(ctxt->sys_regs[TCR_EL1], SYS_TCR);
124124
} else if (!ctxt->__hyp_running_vcpu) {
@@ -149,7 +149,7 @@ static void __hyp_text __sysreg_restore_el1_state(struct kvm_cpu_context *ctxt)
149149
write_sysreg(ctxt->sys_regs[PAR_EL1], par_el1);
150150
write_sysreg(ctxt->sys_regs[TPIDR_EL1], tpidr_el1);
151151

152-
if (cpus_have_const_cap(ARM64_WORKAROUND_1319367) &&
152+
if (cpus_have_const_cap(ARM64_WORKAROUND_SPECULATIVE_AT_NVHE) &&
153153
ctxt->__hyp_running_vcpu) {
154154
/*
155155
* Must only be done for host registers, hence the context

arch/arm64/kvm/hyp/tlb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void __hyp_text __tlb_switch_to_guest_vhe(struct kvm *kvm,
6363
static void __hyp_text __tlb_switch_to_guest_nvhe(struct kvm *kvm,
6464
struct tlb_inv_context *cxt)
6565
{
66-
if (cpus_have_const_cap(ARM64_WORKAROUND_1319367)) {
66+
if (cpus_have_const_cap(ARM64_WORKAROUND_SPECULATIVE_AT_NVHE)) {
6767
u64 val;
6868

6969
/*
@@ -117,7 +117,7 @@ static void __hyp_text __tlb_switch_to_host_nvhe(struct kvm *kvm,
117117
{
118118
write_sysreg(0, vttbr_el2);
119119

120-
if (cpus_have_const_cap(ARM64_WORKAROUND_1319367)) {
120+
if (cpus_have_const_cap(ARM64_WORKAROUND_SPECULATIVE_AT_NVHE)) {
121121
/* Ensure write of the host VMID */
122122
isb();
123123
/* Restore the host's TCR_EL1 */

0 commit comments

Comments
 (0)