summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2018-01-03 11:38:35 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2018-01-08 13:46:56 -0500
commit6840bdd73d07216ab4bc46f5a8768c37ea519038 (patch)
treec2322ae1567cb33991bd5c987604704bc208bd31 /virt
parent0f15adbb2861ce6f75ccfc5a92b19eae0ef327d0 (diff)
arm64: KVM: Use per-CPU vector when BP hardening is enabled
Now that we have per-CPU vectors, let's plug then in the KVM/arm64 code. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/arm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index c8d49879307f..2df6a5c42f77 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -1158,7 +1158,7 @@ static void cpu_init_hyp_mode(void *dummy)
1158 pgd_ptr = kvm_mmu_get_httbr(); 1158 pgd_ptr = kvm_mmu_get_httbr();
1159 stack_page = __this_cpu_read(kvm_arm_hyp_stack_page); 1159 stack_page = __this_cpu_read(kvm_arm_hyp_stack_page);
1160 hyp_stack_ptr = stack_page + PAGE_SIZE; 1160 hyp_stack_ptr = stack_page + PAGE_SIZE;
1161 vector_ptr = (unsigned long)kvm_ksym_ref(__kvm_hyp_vector); 1161 vector_ptr = (unsigned long)kvm_get_hyp_vector();
1162 1162
1163 __cpu_init_hyp_mode(pgd_ptr, hyp_stack_ptr, vector_ptr); 1163 __cpu_init_hyp_mode(pgd_ptr, hyp_stack_ptr, vector_ptr);
1164 __cpu_init_stage2(); 1164 __cpu_init_stage2();
@@ -1403,6 +1403,12 @@ static int init_hyp_mode(void)
1403 goto out_err; 1403 goto out_err;
1404 } 1404 }
1405 1405
1406 err = kvm_map_vectors();
1407 if (err) {
1408 kvm_err("Cannot map vectors\n");
1409 goto out_err;
1410 }
1411
1406 /* 1412 /*
1407 * Map the Hyp stack pages 1413 * Map the Hyp stack pages
1408 */ 1414 */