@@ -29,7 +29,7 @@ static void __hyp_text __activate_traps(struct kvm_vcpu *vcpu)
* we set FPEXC.EN to prevent traps to EL1, when setting the TFP bit.
*/
val = vcpu->arch.hcr_el2;
- if (val & HCR_RW) {
+ if (!(val & HCR_RW)) {
write_sysreg(1 << 30, fpexc32_el2);
isb();
}
@@ -118,7 +118,7 @@ static int __hyp_text __guest_run(struct kvm_vcpu *vcpu)
exit_code = __guest_enter(vcpu, host_ctxt);
/* And we're baaack! */
- fp_enabled = !!(read_sysreg(cptr_el2) & CPTR_EL2_TFP);
+ fp_enabled = !(read_sysreg(cptr_el2) & CPTR_EL2_TFP);
__sysreg_save_state(guest_ctxt);
__sysreg32_save_state(vcpu);