Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: arm64: Remove redundant Spectre-v2 code from kvm_map_vector()

'__kvm_bp_vect_base' is only used when dealing with the hardened vectors
so remove the redundant assignments in kvm_map_vectors().

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20201113113847.21619-2-will@kernel.org

authored by

Will Deacon and committed by
Marc Zyngier
8934c845 f8394f23

-5
-5
arch/arm64/kvm/arm.c
··· 1306 1306 * !SV2 + HEL2 -> allocate one vector slot and use exec mapping 1307 1307 * SV2 + HEL2 -> use hardened vectors and use exec mapping 1308 1308 */ 1309 - if (cpus_have_const_cap(ARM64_SPECTRE_V2)) { 1310 - __kvm_bp_vect_base = kvm_ksym_ref(__bp_harden_hyp_vecs); 1311 - __kvm_bp_vect_base = kern_hyp_va(__kvm_bp_vect_base); 1312 - } 1313 - 1314 1309 if (cpus_have_const_cap(ARM64_HARDEN_EL2_VECTORS)) { 1315 1310 phys_addr_t vect_pa = __pa_symbol(__bp_harden_hyp_vecs); 1316 1311 unsigned long size = __BP_HARDEN_HYP_VECS_SZ;