• Simon Guo's avatar
    KVM: PPC: Book3S PR: Add math support for PR KVM HTM · 13989b65
    Simon Guo authored
    The math registers will be saved into vcpu->arch.fp/vr and corresponding
    vcpu->arch.fp_tm/vr_tm area.
    
    We flush or giveup the math regs into vcpu->arch.fp/vr before saving
    transaction. After transaction is restored, the math regs will be loaded
    back into regs.
    
    If there is a FP/VEC/VSX unavailable exception during transaction active
    state, the math checkpoint content might be incorrect and we need to do
    treclaim./load the correct checkpoint val/trechkpt. sequence to retry the
    transaction. That will make our solution complicated. To solve this issue,
    we always make the hardware guest MSR math bits (shadow_msr) consistent
    with the MSR val which guest sees (kvmppc_get_msr()) when guest msr is
    with tm enabled. Then all FP/VEC/VSX unavailable exception can be delivered
    to guest and guest handles the exception by itself.
    Signed-off-by: default avatarSimon Guo <wei.guo.simon@gmail.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    13989b65
book3s_pr.c 49.8 KB