Make sure that the capability vector is being updated accordingly during the context switch.
Signed-off-by: Beata Michalska beata.michalska@arm.com --- arch/arm64/kvm/hyp/nvhe/switch.c | 4 ++-- arch/arm64/kvm/hyp/vhe/switch.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c index c50f8459e4fc..e19243367408 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -64,7 +64,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu) }
kvm_write_cptr_el2(val); - write_sysreg(__this_cpu_read(kvm_hyp_vector), vbar_el2); + write_sysreg_variant(__this_cpu_read(kvm_hyp_vector), vbar_el2);
if (cpus_have_final_cap(ARM64_WORKAROUND_SPECULATIVE_AT)) { struct kvm_cpu_context *ctxt = &vcpu->arch.ctxt; @@ -109,7 +109,7 @@ static void __deactivate_traps(struct kvm_vcpu *vcpu) write_sysreg(this_cpu_ptr(&kvm_init_params)->hcr_el2, hcr_el2);
kvm_reset_cptr_el2(vcpu); - write_sysreg(__kvm_hyp_host_vector, vbar_el2); + write_sysreg_variant(__kvm_hyp_host_vector, vbar_el2); }
/* Save VGICv3 state on non-VHE systems */ diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c index 1581df6aec87..e4fc314a83a6 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -85,7 +85,7 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
write_sysreg(val, cpacr_el1);
- write_sysreg(__this_cpu_read(kvm_hyp_vector), vbar_el1); + write_sysreg_variant(__this_cpu_read(kvm_hyp_vector), vbar_el1); } NOKPROBE_SYMBOL(__activate_traps);
@@ -132,7 +132,7 @@ static void __deactivate_traps(struct kvm_vcpu *vcpu)
if (!arm64_kernel_unmapped_at_el0()) host_vectors = __this_cpu_read(this_cpu_vector); - write_sysreg(host_vectors, vbar_el1); + write_sysreg_variant(host_vectors, vbar_el1); } NOKPROBE_SYMBOL(__deactivate_traps);