Merge branch 'kvm-arm64/host-stage2' into kvmarm-master/next
authorMarc Zyngier <maz@kernel.org>
Tue, 13 Apr 2021 14:35:09 +0000 (15:35 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 13 Apr 2021 14:35:09 +0000 (15:35 +0100)
Signed-off-by: Marc Zyngier <maz@kernel.org>
1  2 
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/switch.c

Simple merge
Simple merge
index 736805232521e783b784edf975c37111a4176950,5fb570e68831d2808324c97a9c76877dd75e3ff9..e9f6ea704d07d02b6ea986886e29ca68f1d89ddf
@@@ -95,20 -97,16 +97,17 @@@ static void __deactivate_traps(struct k
  
        mdcr_el2 &= MDCR_EL2_HPMN_MASK;
        mdcr_el2 |= MDCR_EL2_E2PB_MASK << MDCR_EL2_E2PB_SHIFT;
 +      mdcr_el2 |= MDCR_EL2_E2TB_MASK << MDCR_EL2_E2TB_SHIFT;
  
        write_sysreg(mdcr_el2, mdcr_el2);
-       if (is_protected_kvm_enabled())
-               write_sysreg(HCR_HOST_NVHE_PROTECTED_FLAGS, hcr_el2);
-       else
-               write_sysreg(HCR_HOST_NVHE_FLAGS, hcr_el2);
-       write_sysreg(CPTR_EL2_DEFAULT, cptr_el2);
-       write_sysreg(__kvm_hyp_host_vector, vbar_el2);
- }
+       write_sysreg(this_cpu_ptr(&kvm_init_params)->hcr_el2, hcr_el2);
  
- static void __load_host_stage2(void)
- {
-       write_sysreg(0, vttbr_el2);
+       cptr = CPTR_EL2_DEFAULT;
+       if (vcpu_has_sve(vcpu) && (vcpu->arch.flags & KVM_ARM64_FP_ENABLED))
+               cptr |= CPTR_EL2_TZ;
+       write_sysreg(cptr, cptr_el2);
+       write_sysreg(__kvm_hyp_host_vector, vbar_el2);
  }
  
  /* Save VGICv3 state on non-VHE systems */