diff options
| -rw-r--r-- | arch/arm64/kvm/hyp/switch.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index d496ef579859..ca46153d7915 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c | |||
| @@ -98,8 +98,10 @@ static void activate_traps_vhe(struct kvm_vcpu *vcpu) | |||
| 98 | val = read_sysreg(cpacr_el1); | 98 | val = read_sysreg(cpacr_el1); |
| 99 | val |= CPACR_EL1_TTA; | 99 | val |= CPACR_EL1_TTA; |
| 100 | val &= ~CPACR_EL1_ZEN; | 100 | val &= ~CPACR_EL1_ZEN; |
| 101 | if (!update_fp_enabled(vcpu)) | 101 | if (!update_fp_enabled(vcpu)) { |
| 102 | val &= ~CPACR_EL1_FPEN; | 102 | val &= ~CPACR_EL1_FPEN; |
| 103 | __activate_traps_fpsimd32(vcpu); | ||
| 104 | } | ||
| 103 | 105 | ||
| 104 | write_sysreg(val, cpacr_el1); | 106 | write_sysreg(val, cpacr_el1); |
| 105 | 107 | ||
| @@ -114,8 +116,10 @@ static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu) | |||
| 114 | 116 | ||
| 115 | val = CPTR_EL2_DEFAULT; | 117 | val = CPTR_EL2_DEFAULT; |
| 116 | val |= CPTR_EL2_TTA | CPTR_EL2_TZ; | 118 | val |= CPTR_EL2_TTA | CPTR_EL2_TZ; |
| 117 | if (!update_fp_enabled(vcpu)) | 119 | if (!update_fp_enabled(vcpu)) { |
| 118 | val |= CPTR_EL2_TFP; | 120 | val |= CPTR_EL2_TFP; |
| 121 | __activate_traps_fpsimd32(vcpu); | ||
| 122 | } | ||
| 119 | 123 | ||
| 120 | write_sysreg(val, cptr_el2); | 124 | write_sysreg(val, cptr_el2); |
| 121 | } | 125 | } |
| @@ -129,7 +133,6 @@ static void __hyp_text __activate_traps(struct kvm_vcpu *vcpu) | |||
| 129 | if (cpus_have_const_cap(ARM64_HAS_RAS_EXTN) && (hcr & HCR_VSE)) | 133 | if (cpus_have_const_cap(ARM64_HAS_RAS_EXTN) && (hcr & HCR_VSE)) |
| 130 | write_sysreg_s(vcpu->arch.vsesr_el2, SYS_VSESR_EL2); | 134 | write_sysreg_s(vcpu->arch.vsesr_el2, SYS_VSESR_EL2); |
| 131 | 135 | ||
| 132 | __activate_traps_fpsimd32(vcpu); | ||
| 133 | if (has_vhe()) | 136 | if (has_vhe()) |
| 134 | activate_traps_vhe(vcpu); | 137 | activate_traps_vhe(vcpu); |
| 135 | else | 138 | else |
