• Simon Guo's avatar
    KVM: PPC: Book3S PR: Support TAR handling for PR KVM HTM · 7284ca8a
    Simon Guo authored
    Currently guest kernel doesn't handle TAR facility unavailable and it
    always runs with TAR bit on. PR KVM will lazily enable TAR. TAR is not
    a frequent-use register and it is not included in SVCPU struct.
    
    Due to the above, the checkpointed TAR val might be a bogus TAR val.
    To solve this issue, we will make vcpu->arch.fscr tar bit consistent
    with shadow_fscr when TM is enabled.
    
    At the end of emulating treclaim., the correct TAR val need to be loaded
    into the register if FSCR_TAR bit is on.
    
    At the beginning of emulating trechkpt., TAR needs to be flushed so that
    the right tar val can be copied into tar_tm.
    
    Tested with:
    tools/testing/selftests/powerpc/tm/tm-tar
    tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar (remove DSCR/PPR
    related testing).
    Signed-off-by: default avatarSimon Guo <wei.guo.simon@gmail.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    7284ca8a
kvm_book3s.h 12.7 KB