• S
    KVM: PPC: Book3S PR: Restore NV regs after emulating mfspr from TM SPRs · 19c585eb
    Simon Guo 提交于
    Currently kvmppc_handle_fac() will not update NV GPRs and thus it can
    return with GUEST_RESUME.
    
    However PR KVM guest always disables MSR_TM bit in privileged state.
    If PR privileged-state guest is trying to read TM SPRs, it will
    trigger TM facility unavailable exception and fall into
    kvmppc_handle_fac().  Then the emulation will be done by
    kvmppc_core_emulate_mfspr_pr().  The mfspr instruction can include a
    RT with NV reg. So it is necessary to restore NV GPRs at this case, to
    reflect the update to NV RT.
    
    This patch make kvmppc_handle_fac() return GUEST_RESUME_NV for TM
    facility unavailable exceptions in guest privileged state.
    Signed-off-by: NSimon Guo <wei.guo.simon@gmail.com>
    Reviewed-by: NPaul Mackerras <paulus@ozlabs.org>
    Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
    19c585eb
book3s_pr.c 50.5 KB